Vertex program and OpenGL states

Hello,
I want to use a vertex program to render water in my game but I have a problem.
For this test I removed nearly every object of the scene (the terrain is still present).
I just have a simple object using one texture and an object that is rendered using multipass and bump mapping.

case 0 (VP active):
a: I setup my render pass
b: I render my terrain
c: I enable vertex program
d: I bind my program to render my water
e: I render my water using glDrawArrays
f: I disable vertex program
g: I render the rest of my geometry (in this test, the simple object and the “complex” one)
h: I go to “a:”
result: the lighting is disabled for the simple object in “g:”

case 1 (no VP binding):
a: I setup my render pass
b: I render my terrain
c: I enable vertex program
no “d:”
e: I render my water using glDrawArrays
f: I disable vertex program
g: I render the rest of my geometry
h: I go to “a:”
result: nothing is rendered after the terrain, my game is still running but no more rendering occurs

case 2 (VP disabled before rendering water):
a: I setup my render pass
b: I render my terrain
c: I enable vertex program
d: I bind my program to render my water
f: I disable vertex program
e: I render my water using glDrawArrays
g: I render the rest of my geometry
h: I go to “a:”
result: no problem

case 3 (no VP):
a: I setup my render pass
b: I render my terrain
no “c:”
no “d:”
e: I render my water using glDrawArrays
no “f:”
g: I render the rest of my geometry
h: I go to “a:”
result: no problem

I think it is really strange…and I really don’t know what’s happening…thanks for any idea.

system:
GNU/Linux slackware 9.1
nvidia drivers 61.06
GeForce 2 GTS DDR 64MB

here is the VP I’m using for the tests:

!!ARBvp1.0
ATTRIB iPos = vertex.position;
ATTRIB iCol = vertex.color;

PARAM mvp[4] = {state.matrix.mvp};

OUTPUT oPos = result.position;
OUTPUT oCol = result.color;

DP4 oPos.x, mvp[0], iPos;
DP4 oPos.y, mvp[1], iPos;
DP4 oPos.z, mvp[2], iPos;
DP4 oPos.w, mvp[3], iPos;

MOV oCol, iCol;

END

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.