|
In the Forums... |
Posted: June 11, 2000 Written by: Tuan "Solace" Nguyen Per-Pixel Shading (cont.) Per-pixel shading is useful for simulating natural phenomena and accurate surface attributes such as fur, cloth, metals, glass, rock, and other highly detailed surfaces. Traditionally, effects were done on an entire triangle and sometimes an entire texture using a technique called interpolation. Special effects were done using calculations based on the vertices of the triangle and interpolating the entire area from the vertices. The end result is a generalized visual appearance… like an estimate or approximation of the final image. The benefit of using interpolation is it is fast to apply. But, the downside to it is that with large triangles, the resulting image contains artifacts, which degrades overall image accuracy and quality. Per-Pixel Lighting: Using per-pixel shading, effects and calculations are applied to individual pixels. Since the triangle will be composed of many pixels, the resulting image is highly accurate in representing what the image was intended to be. Let's assume that a generic triangle is drawn together (including its area) using 100 pixels. Now, we also have a effect pallet of 10 effects. Each pixel then, can accept any one of the ten that are available. That's an outcome of 10,000 different possible effects just for that one triangle. If interpolation was used, then the effect is fixed using that one out of ten effects and generalized across the entire triangle. Below is a visual comparison between interpolation and per-pixel shading. Notice how the sphere and ring look extremely complex? In actuality, both are very simple and do not contain radically different geometric differences. However, the dents and grooves are vastly superior to previous forms of bump mapping and contain a extremely high level if clarity and sharpness. |
||
|
---|