Per Pixel Lighting -> ARB Conversion Problem

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 :

Normaly, before, with the “GL_NV_vertex_program” extension, the result was :

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

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.

Originally posted by Leyder Dylan:
[b]…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.[/b]

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?

Thanks all, the problem was coming the ARB Vertex String