Per pixel lighting

Anyone does help me on per pixel lighting implementation?

Try to specify what you want to accomplish. Tell people what you already figured out, whether you want some pointers to general tutorials (nehe.gamedev.com, developer.nvidia.com are usually good places to start) or have a specific problem.

What features of the GPU do you want to use: fixed-function texEnv extensions, register-combiners, ARB_fragment_program/shader, etc.

Unless you get more specific, you will probably not get that many useful answers.

Regards,

Jan

thanks …

I’ve already written plenty of demos that use Per Pixel lighting (even vertex shaders accelerated) so shoot me a message if you need help :slight_smile:

gooooooood!
Hi Cool Dude! … i want to implements a simple rendering algorithm rhat use vertex program for coucalating lighting effects per pixel … if you have some sample source … send me please …
it’s very important for me … if you do not use vertex program … no problem … send me the sources!!!

take a look to AURIGA … (my project)

http://xoomer.virgilio.it/auriga/Home.html

my project is to create a java Doom3 map viewer …
every contribution is accepted!!

Vertex programs alone won’t help you much. If you don’t want to use fragment-shaders (which is advisable given the current hardware support is limited to GeforceFX/Radeon 9500+, etc), you can calculate the light-dir in a vertex shader as primary-color and then use tex_env_dot3-extension to calculate a dot3 against a bump-map.

This is only the basic idea but it should get you started. You might want to renormalize the light-dir in a normal-map since the linear interpolation between vertices will otherwise dim your light a little bit, etc.

Of course, this only gives you diffuse color (no speculars) but you should get the idea.
When I did something similar for a terrain-rendering-engine, what helped me a lot was to write down the lighting-math first and then try to figure out how you can map that to whatever hardware you have (register-combiners, ATI_fragment_shader, texEnv-dot3, etc).

Feel free to mail me if you have questions (jeNO@SPAMframesys.de)

Jan