Cover image for Professional WebGL Programming : Developing 3D Graphics for the Web.
Professional WebGL Programming : Developing 3D Graphics for the Web.
Title:
Professional WebGL Programming : Developing 3D Graphics for the Web.
Author:
Anyuru, Andreas.
ISBN:
9781119940586
Personal Author:
Edition:
1st ed.
Physical Description:
1 online resource (364 pages)
Contents:
Professional WebGL™: Programming Developing 3D Graphics for the Web -- About the author -- About the technical editor -- Credits -- Acknowledgments -- Contents -- Introduction -- Who this Book is For -- What this Book Covers -- How this Book Is Structured -- What you Need to Use this Book -- Conventions -- Source Code -- Errata -- P2p.Wrox.Com -- Chapter 1: Introducing WebGL -- The Basics of WebGL -- So Why Is WebGL So Great? -- Designing a Graphics API -- An Immediate-Mode API -- A Retained-Mode API -- An Overview of Graphics Hardware -- GPU -- Framebuffer -- Texture Memory -- Video Controller -- Understanding the WebGL Graphics Pipeline -- Vertex Shader -- Primitive Assembly -- Rasterization -- Fragment Shader -- Per Fragment Operations -- Comparing WebGL to Other Graphics Technologies -- OpenGL -- OpenGL ES 2.0 -- Direct3D -- HTML5 Canvas -- Scalable Vector Graphics -- VRML and X3D -- Linear Algebra for 3D Graphics -- Coordinate System -- Points or Vertices -- Vectors -- Dot Product or Scalar Product -- Cross Product -- Homogeneous Coordinates -- Matrices -- Affine Transformations -- Summary -- Chapter 2: Creating Basic WebGL Examples -- Drawing a Triangle -- Creating the WebGL Context -- Creating the Vertex Shader and the Fragment Shader -- Compiling the Shaders -- Creating the Program Object and Linking the Shaders -- Setting Up the Buffers -- Drawing the Scene -- Understanding the WebGL Coding Style -- Debugging Your WebGL Application -- Using Chrome Developer Tools -- Using Firebug -- WebGL Error Handling and Error Codes -- WebGL Inspector -- Troubleshooting WebGL -- Using the DOM API to Load Your Shaders -- Putting It Together in a Slightly More Advanced Example -- Experimenting with Code -- Summary -- Chapter 3: Drawing -- WebGL Drawing Primitives and Drawing Methods -- Primitives -- Understanding the Importance of Winding Order.

WebGL's Drawing Methods -- Typed Arrays -- Buffer and View -- Supported View Types -- Exploring Different Ways to Draw -- gl.drawArrays() and gl.TRIANGLES -- gl.drawArrays() and gl.TRIANGLE_STRIP -- gl.drawElements() and gl.TRIANGLES -- gl.drawElements() and gl.TRIANGLE_STRIP -- Conclusions of the Comparison -- Pre-Transform Vertex Cache and Post-Transform Vertex Cache -- Interleaving Your Vertex Data for Improved Performance -- Using an Array of Structures -- Using a Vertex Array or Constant Vertex Data -- A Last Example to Wind Things Up -- Some Things to Experiment With -- Summary -- Chapter 4: Compact JavaScript Libraries And Transformations -- Working with Matrices and Vectors in JavaScript -- Sylvester -- WebGL-mjs -- glMatrix -- Using Transformations -- How Transformations Are Used -- Understanding the Complete Transformation Pipeline -- Getting Practical with Transformations -- Setting Up Buffers with Object Coordinates -- Creating Transformation Matrices with JavaScript and Uploading Them to the Shader -- Uploading the Transformation Matrices to the Vertex Shader in the GPU -- Calling Your Drawing Methods -- Understanding the Importance of Transformation Order -- Using a Grand, Fixed Coordinate System -- Using a Moving, Local Coordinate System -- Pushing and Popping Transformation Matrices -- A Complete Example: Drawing Several Transformed Objects -- Creating a Cube with WebGL -- Organization of the View Transformation and the Model Transformation -- Summary -- Chapter 5: Texturing -- Understanding Lost Context -- Understanding the Setup Required to Handle Lost Context -- Factors to Consider When Handling Lost Context -- Introducing 2D Textures and Cubemap Textures -- Loading Your Textures -- Creating a WebGLTexture Object -- Binding Your Texture -- Loading the Image Data -- Uploading the Texture to the GPU -- Specifying Texture Parameters.

Understanding the Complete Procedure of Loading a Texture -- Defining Your Texture Coordinates -- Using Your Textures in Shaders -- Working with Texture Image Units -- Working with Texture Filtering -- Understanding Magnification -- Understanding Minification -- Understanding Mipmapping -- Understanding Texture Coordinate Wrapping -- Using the gl.REPEAT Wrap Mode -- Using the gl.MIRRORED_REPEAT Wrap Mode -- Using the gl.CLAMP_TO_EDGE Wrap Mode -- A Complete Texture Example -- Using Images for Your Textures -- Downloading Free Textures -- Basing Textures on Your Own Photos -- Drawing Images -- Buying Textures -- Understanding Same-Origin Policy and Cross-Origin Resource Sharing -- Understanding Same-Origin Policy for Images in General -- Understanding Same-Origin Policy for Textures -- Understanding Cross-Origin Resource Sharing -- Summary -- Chapter 6: Animations And User Input -- Animating the Scene -- Using setInterval() and setTimeout() -- Using requestAnimationFrame() -- Compensating Movement for Different Frame Rates -- Creating an FPS Counter to Measure the Smoothness of Your Animation -- Understanding the Disadvantages of Using FPS as a Measurement -- Event Handling for User Interaction -- Basic Event Handling with DOM Level 0 -- Advanced Event Handling with DOM Level 2 -- Key Input -- Mouse Input -- Applying Your New Knowledge -- Summary -- Chapter 7: Lighting -- Understanding Light -- Working with a Local Lighting Model -- Understanding the Phong Reflection Model -- Ambient Reflection -- Diffuse Reflection -- Specular Reflection -- Understanding the Complete Equation and Shaders for the Phong Reflection Model -- Using Lighting with Texturing -- Understanding the JavaScript Code Needed for WebGL Lighting -- Setting Up Buffers with Vertex Normals -- Calculating and Uploading the Normal Matrix to the Shader.

Uploading the Light Information to the Shader -- Using Different Interpolation Techniques for Shading -- Flat Shading -- Gouraud Shading -- Phong Shading -- Understanding the Vectors That Must Be Normalized -- Normalization in the Vertex Shader -- Normalization in the Fragment Shader -- Using Different Types of Lights -- Directional Lights -- Point Lights -- Spot Lights -- Understanding the Attenuation of Light -- Understanding Light Mapping -- Summary -- Chapter 8: WebGL Performance Optimizations -- WebGL under the Hood -- Hardware that Powers WebGL -- Key Software Components -- WebGL Performance Optimizations -- Avoiding a Typical Beginner's Mistake -- Locating the Bottleneck -- General Performance Advice -- Performance Advice for CPU-Limited WebGL -- Performance Advice for Vertex-Limited WebGL -- Performance Advice for Pixel-Limited WebGL -- A Closer Look at Blending -- Introducing Blending -- Setting the Blending Functions -- Understanding Drawing Order and the Depth Buffer -- Drawing a Scene with Both Opaque and Semi-Transparent Objects -- Changing the Default Operator for the Blend Equation -- Using Premultiplied Alpha -- Taking WebGL Further -- Using WebGL Frameworks -- Publishing to the Google Chrome Web Store -- Using Additional Resources -- Summary -- Index -- Advertisement.
Abstract:
Everything you need to know about developing hardware-accelerated 3D graphics with WebGL! As the newest technology for creating 3D graphics on the web, in both games, applications, and on regular websites, WebGL gives web developers the capability to produce eye-popping graphics. This book teaches you how to use WebGL to create stunning cross-platform apps. The book features several detailed examples that show you how to develop 3D graphics with WebGL, including explanations of code snippets that help you understand the why behind the how. You will also develop a stronger understanding of WebGL development from coverage that: Provides a comprehensive overview of WebGL and shows how it relates to other graphics-related technologies Addresses important topics such as the WebGL graphics pipeline, 3D transformations, texturing and lighting Teaches you how to write vertex shaders and fragment shaders for WebGL Includes a lot of useful guidelines, tips, and tricks for WebGL performance optimizations Professional WebGL Programming is the first book on the market to delve into this fascinating topic and it puts you on your way to mastering the possibilities that exist with WebGL.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: