Texture problems

I’m trying to do very simple rendering.
My vertex buffer has 8 floats per vertex (3 for position, 3 for normal, 2 for texture)
I’m drawing two triangles, each having its 3 vertices, but I’m getting one triangle drawing ok, and the other with strange results.

These are the vertices (CCW, as required)
-0.5,0.5,0,0,0,1,0,0
0.5,-0.5,0,0,0,1,1,1
0.5,0.5,0,0,0,1,1,0
-0.5,0.5,0,0,0,1,0,0
-0.5,-0.5,0,0,0,1,0,1
0.5,-0.5,0,0,0,1,1,1

and the indices are simply 0,1,2 and 3,4,5

My texture is the test pattern:

and the resulting rendering looks like:

I would appreciate any idea on why this happens.

[QUOTE=Photon;1245081]I’m trying to do very simple rendering.
My vertex buffer has 8 floats per vertex (3 for position, 3 for normal, 2 for texture)
I’m drawing two triangles, each having its 3 vertices, but I’m getting one triangle drawing ok, and the other with strange results.

These are the vertices (CCW, as required)
-0.5,0.5,0,0,0,1,0,0
0.5,-0.5,0,0,0,1,1,1
0.5,0.5,0,0,0,1,1,0
-0.5,0.5,0,0,0,1,0,0
-0.5,-0.5,0,0,0,1,0,1
0.5,-0.5,0,0,0,1,1,1

and the indices are simply 0,1,2 and 3,4,5

My texture is the test pattern:

and the resulting rendering looks like:

I would appreciate any idea on why this happens.[/QUOTE]

Can you paste your texture mapping code directly here?

Though you have described your problem abstractly right but paste some significant code is much persuasive and conveneint for test.

Best regards,

newbiecow

After struggling with this for a long time, I did manage to find the cause, albeit by accident.
I tried to run it on another machine and then got a link error from the shader program. The bug was that I defined an input to the fragment shader with an incorrect type (vec3 instead of vec2).

It seems that my main machine (with nVidia 650m) simply ignored the problem and continued to generate this display. The other machine produced an error and then discovering the bug was trivial.

[QUOTE=Photon;1245214]After struggling with this for a long time, I did manage to find the cause, albeit by accident.
I tried to run it on another machine and then got a link error from the shader program. The bug was that I defined an input to the fragment shader with an incorrect type (vec3 instead of vec2).

It seems that my main machine (with nVidia 650m) simply ignored the problem and continued to generate this display. The other machine produced an error and then discovering the bug was trivial.[/QUOTE]

Very well! At least you found the cause and solved it!