WebGL Textures & Vertices
Procedural Textures Bonus Project
The procedural textures
in this section include
a blue to green linear gradient,
red and blue striped texture,
texture with different colored tiles,
random green and red texture,
and a solid red square.
In the process we introduce the WebGL array type
and an overloaded version of the WebGL method
Procedural textures include a few advantages. First procedural textures are lightweight. They usually require less memory.
Second the procedural texture initialization,
in this book, is
event listeners are asynchronous.
Asynchronous means we have to wait, an unspecified amount of time,
before the image file
loads. We can't complete processing the texture until the file loads.
With synchronous processes, source code can move from one initialization method to the next. Therefore procedural textures allow more immediate texture processing.
to resize the canvas for mobile devices, rotations, scrolling, and browser resize events.
The newest e-book
WebGL Beginner's Guide: For Designers and Developers
demonstrates responsive Web design with WebGL.
Fourth procedural texture generation includes the ability to create algorithms of imaginative, complex, and sometimes surreal beauty.
Perhaps the only disadvantage to procedural textures involves processing time. With complicated textures many lines of code execute before the texture completes preparation. The simple textures demonstrated in this section require minimal processing time.