March 2013
Intermediate to advanced
984 pages
26h 18m
English
Before we analyze those techniques in depth, let’s discuss how OpenGL internally works with colors. We know that the framebuffer requires red, green, and blue values to specify a color for a pixel, so hopefully it’s clear that we’ll need to provide enough information to the fragment shader to generate those values.
In the most common cases, OpenGL internally represents a color component as a floating-point value and maintains its precision until that value is stored in the framebuffer. Put another way, unless you specify otherwise, a fragment shader will receive its inputs as floating-point values, which it assigns to its fragment’s color, and those values are expected to be in the range [0.0, 1.0]—what we’ll called ...