Game Development Reference
In-Depth Information
DrawBox(btVector3(1, 1, 1) , btVector3(1.0f,
0.2f, 0.2f) );
Feel free to tweak the highlighted values until you find a color you prefer.
Tip
Note that even though color itself is not a vector, a btVector3 is a convenient
object to use to store three unique floats.
Understanding rendering pipelines
So far (and throughout the remainder of this topic), we have performed rendering
through a technique called immediate mode , where the graphics system essentially
forgets the information of each render-call, and must be reminded of the data every
time we draw. We have witnessed this in our DrawBox() function, where we literally
rewrite the information to define and draw our box every single time the function is
called, and it is called every single render-call. This is obviously not the most efficient
way of doing things!
Immediate mode is opposite to retained mode where vertex data is stored (retained)
within memory, and recalled by the graphics system when requested. The retained
mode method consumes more memory during runtime, but it is much faster and
more efficient. However, it can be difficult to understand and use when you're just
starting with the 3D graphics.
In addition, there are two types of high-level rendering process called the fixed-func-
tion pipeline and the programmable pipeline . All of the code in this topic performs
its rendering using the fixed-function pipeline. It is called so because it follows a fixed
series of function calls to draw the graphical elements to the screen, such as pro-
cessing the primitives, performing transforms and lighting, coloring, depth testing,
and so on. The important point to make here is that the order of these steps cannot
be changed and you have a limited amount of control over each step.
The more modern form of rendering is the programmable pipeline. It is much more
fluid, allowing the graphics programmer to have an immense amount of control over
Search WWH ::




Custom Search