VeliV's picture

Multiple texture coordinates with VBOs?

Hi ya.

How could I tell OpenGL that my model has 2 sets of uve coordinates (one for textures one for lightmap)?

I have been trying to use GL.TexCoordPointer but havent had much luck with that. Is there some other method I could use?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
VeliV's picture

*meh*

Why do I always figure these thing out after I have already posted a topic?

I changed the code to this:

			GL.TexCoordPointer( 	4, 	TexCoordPointerType.Float, 	10 * sizeof( float ), (IntPtr) ( 6 * sizeof( float ) ) );
 
			//GL.TexCoordPointer( 2,	TexCoordPointerType.Float,	10 * sizeof( float ), (IntPtr) ( 8 * sizeof( float ) ) );

giving it 4 floats instead of 2.

After that I changed my shader to

uniform sampler2D tex;
uniform sampler2D light;
 
void main()
{
	gl_FragColor = gl_Color * 
				 texture2D(tex, gl_TexCoord[0].xy) *
				 texture2D(light, gl_TexCoord[0].zw);
}

so the lightmap texture uses the z and w floats.