PDA

View Full Version : Per Pixel Lighting -> ARB Conversion Problem



Leyder Dylan
10-07-2003, 05:37 AM
Hi,

I've deleted the post for beginning a new one, it will be more easy to follow.

For doing PPL, I was using the "GL_NV_vertex_program" extension and as you can say, it's only for a Nvidia video card. For the moment, I'm trying to convert the code for using "ARB_vertex_program" extension. Everything is OK but not the blending.

For the light, I'm using this texture :

http://users.skynet.be/fa550206/Slug-Production/Temp/ARB-PPL-04.jpg


Normaly, before, with the "GL_NV_vertex_program" extension, the result was :

http://users.skynet.be/fa550206/Slug-Production/Temp/ARB-PPL-02.jpg

As you can see, the lighting is correctly applyed but now, with the "ARB_vertex_program" extension the result is different :

http://users.skynet.be/fa550206/Slug-Production/Temp/ARB-PPL-03.jpg

I think that it's because I'm not using the Register Combiners because this is a NVIDIA extension and it's doesn't work on an ATI video card therefore I'm using the last ARB extension : "ARB_vertex_program".

Here're the 2 passes for doing PPL :


1st Pass :




// Blending Params
glBlendFunc(GL_ONE, GL_ONE);
glEnable(GL_BLEND);

// PPL code here ...




2nt Pass :




// Blending Params
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ONE);

// Modulated map code here ...




The problem comes from the blending params but I don't know how the setting up the blending function.

Thanks.

Obli
10-07-2003, 06:43 AM
Originally posted by Leyder Dylan:
...I think that it's because I'm not using the Register Combiners because this is a NVIDIA extension and it's doesn't work on an ATI video card therefore I'm using the last ARB extension : "ARB_vertex_program".

Here're the 2 passes for doing PPL :
...
...

The problem comes from the blending params but I don't know how the setting up the blending function.

Thanks.

Wait, I don't follow you. If you are using BlendFunc, register combiners are out of the way (what are you doing?). If you are using ARB_vp instead of NV_vp, then the vertex program is where you should look for problems. Per fragment math should still work fine.

Your "light map" seems to be slapped on the polygon using texCoords. Maybe you are assuming vertex attribute aliasing?

Leyder Dylan
10-08-2003, 07:56 AM
Thanks all, the problem was coming the ARB Vertex String