Book Image

WebGL Game Development

By : Sumeet Arora
Book Image

WebGL Game Development

By: Sumeet Arora

Overview of this book

<p>WebGL, the web implementation of Open GL, is a JavaScript API used to render interactive 3D graphics within any compatible web browser, without the need for plugins. It helps you create detailed, high-quality graphical 3D objects easily. WebGL elements can be mixed with other HTML elements and composites to create high-quality, interactive, creative, innovative graphical 3D objects.</p> <p>This book begins with collecting coins in Super Mario, killing soldiers in Contra, and then quickly evolves to working out strategies in World of Warcraft. You will be guided through creating animated characters, image processing, and adding effects as part of the web page canvas to the 2D/3D graphics. Pour life into your gaming characters and learn how to create special effects seen in the most powerful 3D games. Each chapter begins by showing you the underlying mathematics and its programmatic implementation, ending with the creation of a complete game scene to build a wonderful virtual world.</p>
Table of Contents (17 chapters)
WebGL Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Applying filtering modes


To apply filtering modes to our texture, we will add three dropdowns:

  • Distance: This drop-down will help us move the object closer or farther from the viewer

  • Magnification Filtering: This drop-down holds the magnification filtering modes

  • Minification Filtering: This drop-down holds the minification filtering modes

Open the 04-ApplyingFilteringModes.html file in your editor. We have changed the code to add the drop-downs, as shown in the following code snippet:

<div>
  <label>Minification Filter</label>
  <select id = "minificationFilter">
    <option value = "NEAREST">NEAREST</option>
    <option value = "LINEAR">LINEAR</option>
    <option value = "NEAREST_MIPMAP_NEAREST">NEAREST_MIPMAP_NEAREST</option>
    <option value = "LINEAR_MIPMAP_NEAREST">LINEAR_MIPMAP_NEAREST</option>
    <option value = "NEAREST_MIPMAP_LINEAR">NEAREST_MIPMAP_LINEAR</option>
    <option value = "LINEAR_MIPMAP_LINEAR...