
Per-Pixel Lighting on Geforce2/4MX
Hi,
I''m trying to solve this problem for days now, but I don''t know how I could implement per-pixel (diffuse + specular!) lighting on a Geforce2. Thanks to a fully programable GPU it''s really no problem to implement it on a GeforceFX or a newer Radeon Card because I can do all the calculations in a fragment program. Geforce3/4 is has a really limited range of commands but with NV_register_combiners2, NV_texture_shader, NVparse and some Lookup Texturemaps it''s possible, too.
I think I have to fall back to NV_register_combiners on a Geforce2/4MX, but I couldn''t find a good tutorial about this, I mean something, that gives me an idea how to do a simple calculation with register combiners. I read the first tutorial by Ron Frazier but I didn''t get that working (I can''t understand the register combiner code
) I got diffuse lighting and diffuse bump mapping on a per-pixel basis working (using ARB_texture_env_dot3 and ARB_texture_env_combine) and now I''d like to implement the specular term using register combiners.
Maybe someone could give me a good and simple tutorial about register combiners or an idea how to set up the specular term with them.
TIA,
Flo
PS.: I have to translate the register combiner function calls to ATI_fragment_shader then, (what is quite the same than NV_register_combiner, I think) to support older ATI cards.

Mark Kilgard has written an excellent paper about bump-mapping for GeForce2 generation. You can find it at http://developer.nvidia.com and search for "Robust OpenGL Bump Mapping" or something like that.
Since bump-mapping uses per-pixel lighting, you will implicitly find the info you need there.
As for porting to ATI_fragment_shader it should not be a problem since ATI_fragment_shader itself is a super-set of GF2''s register combiners. Though, it will only be useful for Radeon8500 and the Radeon9000 line (below 9500, because Radeon 9500 and above do support ARB_fragment_program and in this case it''s better to use ARB_fp of course)
Since bump-mapping uses per-pixel lighting, you will implicitly find the info you need there.
As for porting to ATI_fragment_shader it should not be a problem since ATI_fragment_shader itself is a super-set of GF2''s register combiners. Though, it will only be useful for Radeon8500 and the Radeon9000 line (below 9500, because Radeon 9500 and above do support ARB_fragment_program and in this case it''s better to use ARB_fp of course)
Check on my website, I''ve an example for you.
========================
Leyder Dylan (dylan.leyder@slug-production.be.tf
http://www.slug-production.be.tf/
========================
Leyder Dylan (dylan.leyder@slug-production.be.tf
http://www.slug-production.be.tf/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
nvparse goes back to register combiners(1) too.
using Cg you should see the command line.
using Cg you should see the command line.
Game Core
Ok, thank you guys... I got the thing with the register combiners now, It''s actually pretty easy if you understand it 
But, can anyone explain me this Half-Vector Texture thing? The paper by M. Kilgard says, that you use a cubemap for that. How does this cubemap look like? Is it like the "spot-light cube map" on Ron Frazier''s tutorial?

But, can anyone explain me this Half-Vector Texture thing? The paper by M. Kilgard says, that you use a cubemap for that. How does this cubemap look like? Is it like the "spot-light cube map" on Ron Frazier''s tutorial?
http://www.cs.ubc.ca/grads/resources/thesis/May03/Brook_Bakay.pdf
========================
Leyder Dylan (dylan.leyder@slug-production.be.tf
http://www.slug-production.be.tf/
========================
Leyder Dylan (dylan.leyder@slug-production.be.tf
http://www.slug-production.be.tf/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
I think that the GF 4 MX has no Vertex Shader for doing PPL
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
The half-angle vector is for the specular contribution.
Normalization cubemaps can be used for both specular and diffuse contribution.
Yes cubemaps look like what Ron Frazier used, but this time it''s not a spot-like trick.
Leyder Dylan : GF4 MX can support vertex programs in software and it''s pretty fast to be honest.
Normalization cubemaps can be used for both specular and diffuse contribution.
Yes cubemaps look like what Ron Frazier used, but this time it''s not a spot-like trick.
Leyder Dylan : GF4 MX can support vertex programs in software and it''s pretty fast to be honest.
I mean in hardware.
Thanks for your information.
========================
Leyder Dylan (dylan.leyder@slug-production.be.tf
http://www.slug-production.be.tf/
Thanks for your information.
========================
Leyder Dylan (dylan.leyder@slug-production.be.tf
http://www.slug-production.be.tf/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement