|
*** a very useful function
Terms
-----
A skybox object is any regular object that encompass the whole world. In other words:
1) Has a close shape such as a box or a sphere (or any other closed shape)
2) Is big enough so that all the other parts of the world reside inside the skybox object.
For example, a skybox could be a room a sphere with clouds bitmaps etc.
What does this function do and why do we need it ?
--------------------------------------------------
Actually if one doesn't use this function, nothing bad happens.
you can still use your skybox objects and they will work fine.
The only pupose of this function is to give the engine the information
that this object encompass the whole world .
The engine can use this information and get about %10 gain in Frams Per Second Speed
That's why if you have some object that encompass the whole world it is a good deed
to tell the engine about it.
Note that if you use this function, the function STATE_engine_render_on_top_of_previous_rendering()
would have no effect. If one of your objects is a skybox (encompass the whole world)
then using this function would get you more increase in Frames Per Second then using STATE_engine_render_on_top_of_previous_rendering()
Parameters
----------
object_handle: The object which is used as a skybox. Give NULL to tell the engine that
there is bo skybox in use anymore.
Example:
DWORD my_room=STATE_object_create_from_file("my_room.x");
STATE_engine_using_skybox(my_room)
Remakrs:
--------
1) skybox object should not have transparent or translucent polygons.
If they have it simply wont look good.
2) If you ever get to render outside the skybox area , you will see
a mishmash of colors. To avoid this simply don't call STATE_engine_using_skybox()
One can only use this function if you never render outside the bounding box.
Behind the scene (for the curious reader)
-----------------------------------------
When there is an object that is declered as skybox object then the engine does not
clear the screen between two consecutive rendering (since there is no need)
In addition there is also no need for clearing the Zbuffer.
When there is no skybox object but the world is an inddor world,
you can still speed up rendering by calling STATE_engine_using_skybox()
This will prevent the engine from clearing the screen between renders
but the engine would still need to clear the ZBuffer.
See also STATE_engine_render_on_top_of_previous_rendering()
|