Graphics Reference
In-Depth Information
8.16
One-Sided Polygons
One-sided polygons should be used as often as possible. This should be obvious
from previous chapters, but is easy to forget. Using two-sided geometry immedi-
ately doubles the number of triangles your renderer has to deal with. Some applica-
tions make 2-sided geometry as a default, some make one-sided geometry. Others
assign the number of sides based on the material attached to the object. Whichever
is the case in your application, it is worth the trouble to fi nd out and then ensure that
your geometry is one-sided unless you choose to defi ne it as 2-sided.
8.17
Optimization Testing
Optimized geometry will render much more quickly than geometry that has not
been optimized. The difference can be startling. On the feature fi lm Ratatouille , for
instance, optimization was a major priority because some shots took 98 h to render
a single frame. After optimization, the same shots rendered in 50 min a frame
(Kanyuk and Emms 2012 ).
In video games, there is also a time-based standard; frames per second. For a
game to be interactive player responses must be communicated to the screen quickly
or the illusion of interactivity is lost. For most games, this means they must run at
between 30 and 60 frames a second, preferably 60.
To test frame rate, game objects are brought into the game engine and tested. If the
engine cannot maintain its desired frame rate due to the complexity of the geometry
or other problems related to inadequate optimization, the objects will be rejected.
Rendering then, becomes the ultimate test of successful optimization, whether it is
for pre-rendered graphics in a fi lm or real-time rendered graphics in a game.
The fi rst way to test an object's renderability is to put a light in your scene and
render your object. This should always be done at least once before proceeding to
the next step. Some modeling errors are diffi cult to detect, but if they are severe
enough, they will cause an error message or an error in the render itself that will
help you fi nd the problem. It is not necessary to make a beautiful lighting setup for
this test, but it isn't a bad idea to put together a set of work lights to help you evalu-
ate your model.
The work lights should illuminate your model from all sides, and at least one
should cast shadows. If you save the lights to a separate generic fi le, you can import
them as needed to test your geometry.
Testing your object for real-time rendering is best done in the game engine used
for your project, but the hardware shader used in most applications is a reasonable
approximation. One thing that will almost certainly be different is that your com-
puter will probably be more powerful than the target platform of most games, so it
will not give an accurate fps output. Instead, it will tell you only if you have errors
that interfere with the renderers' normal performance.
Search WWH ::




Custom Search