Results 1 to 3 of 3

Thread: Per Pixel Lighting -> ARB Conversion Problem

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Arlon, Belgium
    Posts
    477

    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 :

    Code :
    	// Blending Params
    	glBlendFunc(GL_ONE, GL_ONE);
    	glEnable(GL_BLEND);
     
    	// PPL code here ...

    2nt Pass :

    Code :
    	// 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.

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Aug 2001
    Location
    Italy
    Posts
    625

    Re: Per Pixel Lighting -> ARB Conversion Problem

    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?

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Arlon, Belgium
    Posts
    477

    Re: Per Pixel Lighting -> ARB Conversion Problem

    Thanks all, the problem was coming the ARB Vertex String

Similar Threads

  1. Replies: 0
    Last Post: 03-03-2014, 06:44 PM
  2. Per-Vertex Lighting vs. Per-Pixel Lighting
    By New2CPP in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-14-2010, 09:11 AM
  3. per vertex lighting vs per pixel lighting
    By jide in forum OpenGL: GLSL
    Replies: 18
    Last Post: 11-10-2005, 09:43 PM
  4. Specular per-pixel lighting problem
    By mikeman in forum OpenGL: Advanced Coding
    Replies: 21
    Last Post: 04-07-2004, 02:42 AM
  5. Per-pixel lighting problem?
    By andreiga in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 03-23-2001, 12:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean