WebGL Textures & Vertices

Beginner's Guide

Page Thirty Three

GLEntity Initialization

The controller calls GLEntity method getImageVariables(). Method getImageVariables() obtains variable locations from the shaders, and prepares to load any images. Method setImage() activates when images load asynchronously. However code may call method setImage() synchronously with procedurally generated color data. In that case, the texture initializes without waiting for a file download. Method setImage() completes texture initialization. After all textures have initialized, setImage() calls the controller method setProgramVariables() once.

It's necessary to call the controller's method setProgramVariables() after textures initialize. Method setProgramVariables() validates the program. Some browsers fail validation if shader variables associated with textures, haven't initialized.

Don't feel overwhelmed with the preceding overview. Sections following Entity Details provide step by step instructions to each WebGL feature. See the GLEntity source code.

WebGL Beginner's Guide Introduction WebGL Beginner's Guide
Copyright © 2015 Seven Thunder Software. All Rights Reserved.

Fatal error: Internal zval's can't be arrays, objects or resources in Unknown on line 0