OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.3, Eighth Edition
by Dave Shreiner, Graham Sellers, John M. Kessenich, Bill M. Licea-Kane
Trade-offs
As previously mentioned, three methods can be used to generate noise values in a shader. How do you know which is the best choice for your application? A lot depends on the underlying implementation, but generally speaking, if we assume a hardware computation of noise that does not use texturing, the points favoring usage of GLSL built-in noise function are the following:
• It doesn’t consume any texture memory (a 128 × 128 × 128 texture map stored as RGBA with 8 bits per component uses 8MB of texture memory).
• It doesn’t use a texture unit.
• It is a continuous function rather than a discrete one, so it does not look “pixelated” no matter what the scaling is.
• The repeatability of the function should be undetectable, especially ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access