Archived

This topic is now archived and is closed to further replies.

nes8bit

Lighting and stuff...actually pixel shaders

Recommended Posts

1. The minimum requirement for a programmable pixel shader is actually a GeForce 3 - GF2 only does the fixed function pipeline.


2. Store normals per-pixel in a normal map, pass a light vector in as a constant or an iterated vertex colour, perform the L.N operation to get the intensity, modulate with an attenuation function, add on ambient influence and modulate with the base texture.
This is the same as the DOT3 operation which has been available in the fixed function pipeline since 3DLabs Permedia3 or nVidias GeForce256.


3. There seems to be a lot of misconceptions out there about what vertex and pixel shaders actually do! - A pixel shader is a program which is executed to draw a single pixel of a polygon - it has no knowledge of other pixels, no knowledge of other polygons etc. It does not work the same was as a PS2 Vector Unit, nor a RenderMan shader...
...As for shadows, the tradition methods such as projected shadow maps are still the most common - a pixel shader can be useful for drawing the shadow for such things as softening the edges and making it interact with bump maps correctly. A vertex shader is more useful since it can be used to eliminate back-shadowing and other artefacts.


4. There are samples (with sourcecode) of all of the above at the nVidia website: www.nvidia.com/developer


--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
I didn''t pixel shaders could automatically do shading for me >:/

Anyway, what shader do I use for a simple point light? I''m extremely lazy and don''t have the slightest clue what the code in a shader means

Also, what do you mean by programmable shaders?

---------------------------------------------

Hatten something something something!!

Share this post


Link to post
Share on other sites