Take a simple sphere for example. Through the pixel shader, a simple texture can easily be applied to the plane, and both diffuse and specularity lighting can also be implemented.
The simplest of the detail shaders is normal mapping. A key element in this is a normal map, which is an image that stores normal data.
The normal mapping effect is simply done by setting the x normal to the r value, y to g, and z to b. This distorts the orientaion of the pixel, resulting in shading changes that gives the appearance of small crevices and bumps.
This effect, while decent, still does not give a full 3D effect. The next step up is parallax occlusion mapping.
Using these pixel shader techniques, detail can be added to a model without having to change the geometry of the model, and without affecting the frame rate. These techniques, especially normal mapping are widely used in modern games, and parallax mapping is now starting to be seen. These techniques can optimize your game, as well as make it look better.
No comments:
Post a Comment