Common rendering technology in today's games
notes by Matt Dudley
this is meant to be a short list of common rendering features found in many games/game engines being made today. These notes cover the "base line"/ most common rendering techniques, how they work and why they are important to artists.
First some history:
In the previous generation of 3d games, rendering consisted of lighting based on vertices and usually a single texture to represent the final look of the asset.
vertex lighting has some charm, its the ps2 directX7 look.
-dynamic lighting was expensive performance wise, so static lighting was used.
-lots of vertices is expensive performance wise, so the lighting usually looks chunky and lo-fi.
character art usually had even fewer vertices than environment art because skinning vertices for animation is expensive for perf.
For this reason most ps2 games used no lighting at all on characters so all lighting info was represented/implied in a single diffuse color texture. (painted shadows and highlights)
Present day:
Current graphics and related art center around the use of shaders/materials.
Shaders can be used and described in many ways, but for artists concerns they can be thought of in this way: shaders define how a (polygonal) surface looks when rendered onscreen.
Today it is common to have lighting based on pixel/texel (texture pixel) and where one texture was used before, its common to have 5 textures or more associated with the final look of an asset. (a really good looking asset!)
Today it is common to have lighting based on pixel/texel (texture pixel) and where one texture was used before, its common to have 5 textures or more associated with the final look of an asset. (a really good looking asset!)
Basic Features:
A typical fancy shader has features like:
ambient light: not fancy, a fixed number that sets the darkest darks (dark value range)
specular highlight: a highlight that is added/lightened based on directional light and angle of surface relative to the camera/viewer (highlights)
reflection/cube map/environment map: a texture that is added/lightened across the surface, oriented based on camera/viewer (shiny)
shadow: a color that is multiplied/darkened based on a projection from the directional light in the scene. (dark value range)
all together.
Important Stuff:
the features above are usually calculated in the order they are listed.
All adds up to white:
all of the features besides shadow add/lighten starting from the ambient color -so if your ambient is grey, black values are already ruled out.
Each step narrows the value range towards white, diffuse adds up closer to white, leaving less range for specular, more so with reflections.
Shadows:
after all the adding/lightening is done, the shadows get multiplied in. It gets more complicated if the shader has self shadowing (ie on a character where his raised arm casts a shadow across his chest).
its common to see the self shadow look darker on the raised arm than the cast shadow falling across the character's chest. this is because the shadow facing pixels on the arm are already receiving less light than the light facing pixels on the chest.
this is one of the reasons black or near black shadows are common, it hides the oddness of seeing darker shadows between surfaces.
Patience:
Its common to spend some time tuning all the associated values in order to get a final result that looks "right" -or just not totally blown out.
No comments:
Post a Comment