Sign in to follow this  
sduatepe

Multi Texture Coordinate with VBO nvidia 8 series error

Recommended Posts

Hi Everyone, I'm having problem using texture coordinates NVidia 8 series GPU in glsl shader program. I've got a terrain editor render at the moment using dynamic vertex buffers and index buffers. I've send two texture coordinates to shader program at run time using this dynamic vertex buffers and index buffers. This works great but if I resize the glWindow, application freezes. But it works Nvidia 7 series. Has anyone else experienced this issue? Thanks.

Share this post


Link to post
Share on other sites
Quote:
Original post by sduatepe
Has anyone else experienced this issue?

No.

You probably have a bug in your code. But since you provide no information about what exactly you do, there's not much more one can say about this.

Share this post


Link to post
Share on other sites
Thanks Yann for quick reply.

At run time my application program sends vertex buffer data (Open Scene Graph implemented)

 

state.setVertexPointer(3, GL_FLOAT, sizeof(VertexData), BUFFER_OFFSET(0));
state.setColorPointer(3, GL_FLOAT, sizeof(VertexData), BUFFER_OFFSET(sizeof(float) * 3));
state.setTexCoordPointer(0,3, GL_FLOAT, sizeof(VertexData), BUFFER_OFFSET(sizeof(float) * 6));
state.setNormalPointer(GL_FLOAT, sizeof(VertexData), BUFFER_OFFSET(sizeof(float) * 8 ));
state.setTexCoordPointer(1,3, GL_FLOAT, sizeof(VertexData), BUFFER_OFFSET(sizeof(float)* 11));



My Vertex Shader



varying vec2 v_texCoord;
varying vec2 v_texCoord1;
varying vec4 v_color;

void main()
{

gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

v_texCoord = gl_MultiTexCoord0.xy;
v_texCoord1 = gl_MultiTexCoord1.xy;

v_color = gl_Color;
}


My Fragment Shader



uniform sampler2D base;
uniform sampler2D texture1;

varying vec2 v_texCoord;
varying vec2 v_texCoord1;

void main()
{

vec4 baseColor = texture2D(base, v_texCoord1); // !#?
vec4 color = texture2D(texture1, v_texCoord);

gl_FragColor = (baseColor * 0.5 + color * 0.5 ) * v_color;
}



It freeze, when resizing glWindow


The other fragment shader(It works great)



uniform sampler2D base;
uniform sampler2D texture1;

varying vec2 v_texCoord;
varying vec2 v_texCoord1;

void main()
{

vec4 baseColor = texture2D(base, v_texCoord1); // !#?
vec4 color = texture2D(texture1, v_texCoord);

gl_FragColor = (color * 0.5 ) * v_color;
}


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this