HTML and CSS Reference
In-Depth Information
Listing 9.10. core.js—Shader setup
Step 3: Pull shader data from the DOM
In the previous listing, gd.core.shader.init() accesses the shader-vertex and
shader-fragment scripts you put in index.html. gd.core.shader.get() retrieves and
processes your shader by pulling it from the DOM, sending back a compiled package of
data or an error. gd.core.shader.init() continues processing and attaches your
DOM results to a program. The program sets up vertices, fragments, and color in a store
method. Lastly, all the leftover graphics data is deleted. Replace gd.core.shader
.get() and gd.core.shader.store() with the next listing in core.js to complete
loading your shaders.
Search WWH ::




Custom Search