PDA

View Full Version : gl to uniform parameter binding semantics



gstrickler
01-28-2004, 11:56 AM
The cg language spec says, talking about position invariance...

MVP is a uniform variable (or structure element) of type float4x4 with an input binding semantic that causes it to track the fixed-function modelview-projection matrix.(The name of this binding semantic is currently profile-specific—for OpenGL profiles, the semantic _GL_MVP is recommended).

The arbvp1 profile provides the "glstate" variable that lets me access gl state from the vertex program, per the ARB_vertex_program extension.

In the vp30 profile I think I can make a uniform parameter like this..
uniform float4x4 mvp : _GL_MVP
to bind the gl state to the uniform parameter. Is this right?

How do I bind to other gl states? Where are the binding semantics defined for each profile? I'm hoping _GL_MVP is not the only state available in the vp30 profile.

I hope I just can't find the documentation.

Thanks

Tom Nuydens
01-28-2004, 11:26 PM
Cg questions are better asked at www.cgshaders.org. (http://www.cgshaders.org.) I'll move this thread to the shading language forum though, where someone might be able to answer your question.

-- Tom

Relic
01-29-2004, 12:44 AM
>>I just can't find the documentation.<<
http://developer.nvidia.com/object/cg_toolkit.html
http://www.opengl.org/discussion_boards/ubb/rolleyes.gif

Looks like there is only one explicit matrix binding _GL_MVP for vp30 and only used for position invariance reasons.

[This message has been edited by Relic (edited 01-29-2004).]

gstrickler
01-29-2004, 04:25 AM
If in general I can't see the gl state from the shader, that means I have to rebind the shader whenever the state changes, right? And that means that display lists with projection matrix changes can not work, because the shader will not see the state change, right?