1.

Record Nr.

UNINA9910790491103321

Autore

Cantor Diego

Titolo

WebGL beginner's guide [[electronic resource] ] : become a master of 3D web programming in WebGL and JavaScript / / Diego Cantor, Brandon Jones

Pubbl/distr/stampa

Birmingham, England ; ; Mumbai, India, : Packt Publishing, c2012

ISBN

1-280-87294-2

9786613714251

1-84969-173-8

Edizione

[1st edition]

Descrizione fisica

1 online resource (377 p.)

Collana

Learn by doing : less theory, more results

Altri autori (Persone)

JonesBrandon

Disciplina

006.6869

Soggetti

Computer graphics - Computer programs

HTML (Document markup language)

Internet programming

JavaScript (Computer program language)

Lingua di pubblicazione

Inglese

Formato

Materiale a stampa

Livello bibliografico

Monografia

Note generali

Includes index.

Nota di contenuto

Cover; Copyright; Credits; About the Authors; Acknowledgement; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Getting Started with WebGL; System requirements; What kind of rendering does WebGL offer?; Structure of a WebGL application; Creating an HTML5 canvas; Time for action - creating an HTML5 canvas; Defining a CSS style for the border; Understanding canvas attributes; What if the canvas is not supported?; Accessing a WebGL context; Time for action - accessing the WebGL context; WebGL is a state machine; Time for action - setting up WebGL context attributes

Using the context to access the WebGL APILoading a 3D scene; Virtual car showroom; Time for action - visualizing a finished scene; Summary; Chapter 2: Rendering Geometry; Vertices and Indices; Overview of WebGL's rendering pipeline; Vertex Buffer Objects (VBOs); Vertex shader; Fragment shader; Framebuffer; Attributes, uniforms, and varyings; Rendering geometry in WebGL; Defining a geometry using JavaScript arrays; Creating WebGL buffers; Operations to manipulate WebGL buffers; Associating attributes to VBOs; Binding a VBO; Pointing



an attribute to the currently bound VBO

Enabling the attributeRendering; The drawArrays and drawElements functions; Putting everything together; Time for action - rendering a square; Rendering modes; Time for action - rendering modes; WebGL as a state machine: buffer manipulation; Time for action - enquiring on the state of buffers; Advanced geometry loading techniques: JavaScript Object Notation (JSON) and AJAX; Introduction to JSON - JavaScript Object Notation; Defining JSON-based 3D models; JSON encoding and decoding; Time for action - JSON encoding and decoding; Asynchronous loading with AJAX; Setting up a web server

Working around the web server requirementTime for action - loading a cone with AJAX + JSON; Summary; Chapter 3: Lights!; Lights, normals, and materials; Lights; Normals; Materials; Using lights, normals, and materials in the pipeline; Parallelism and the difference between attributes and uniforms; Shading methods and light reflection models; Shading/interpolation methods; Goraud interpolation; Phong interpolation; Light reflection models; Lambertian reflection model; Phong reflection model; ESSL-OpenGL ES Shading Language; Storage qualifier; Types; Vector components; Operators and functions

Vertex attributesUniforms; Varyings; Vertex shader; Fragment shader; Writing ESSL programs; Goraud shading with Lambertian reflections; Time for action - updating uniforms in real time; Goraud shading with Phong reflections; Time for action - Goraud shading; Phong shading; Time for action - Phong shading with Phong lighting; Back to WebGL; Creating a program; Initializing attributes and uniforms; Bridging the gap between WebGL and ESSL; Time for action - working on the wall; More on lights: positional lights; Time for action - positional lights in action; Nissan GTS example; Summary

Chapter 4: Camera

Sommario/riassunto

Become a master of 3D web programming in WebGL and JavaScript