Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Question about GL_VERTEX_PROGRAM_NV

This topic is 1193 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there!

I know that my question is from the previous century but I want to clarify it. Suppose I have vertex program (from manual)


# c[0-3] = modelview projection (composite) matrix
# c[4-7] = modelview inverse transpose
# c[32] = normalized eye-space light direction (infinite light)
# c[33] = normalized constant eye-space half-angle vector (infinite viewer)
# c[35].x = pre-multiplied monochromatic diffuse light color & diffuse material
# c[35].y = pre-multiplied monochromatic ambient light color & diffuse material
# c[36] = specular color
# c[38].x = specular power
# outputs homogenous position and color
DP4 o[HPOS].x, c[0], v[OPOS];
DP4 o[HPOS].y, c[1], v[OPOS];
DP4 o[HPOS].z, c[2], v[OPOS];
DP4 o[HPOS].w, c[3], v[OPOS];
DP3 R0.x, c[4], v[NRML];
DP3 R0.y, c[5], v[NRML];
DP3 R0.z, c[6], v[NRML]; # R0 = n' = transformed normal
DP3 R1.x, c[32], R0; # R1.x = Lpos DOT n'
DP3 R1.y, c[33], R0; # R1.y = hHat DOT n'
MOV R1.w, c[38].x; # R1.w = specular power
LIT R2, R1; # Compute lighting values
MAD R3, c[35].x, R2.y, c[35].y; # diffuse + emissive
MAD o[COL0].xyz, c[36], R2.z, R3; # + specular

Code is clear to me, question is about parameters. First 8 (c[0]-c[7]) are 'tracked' by glTrackMatrixNV. What about the others? I can load them using glProgramParameter4fNV but I wonder if there is a natural way to track these parameters cause all of them are already given to OpenGL?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!