I am learning how to render 3D objects using webgl (no third-party libraries).
I am currently facing a very confusing situation however, where my textures are rendering apparently twice over a particular triangle, but only on some of the triangles.
I have added a screenshot of the problem, and was rather hoping some gl-ninja in here would be able to point me in the direction of my mistake:
As you can see, most of the textures are rendering fine, the cobble stones and most of the triangles of the crates, I hope it is clear enough, in the top-right triangle of the bottom left crate the system is showing 2 textures (1 incorrect, quite strong, the other correct, quite weak).
I don’t really expect you to wave a wand and fix this (though that would be nice!) I’m just hoping that you recognise the symptoms and can point me in the right direction, either terms to use in Google, or areas in my code that I should give some more thorough scrutiny.
UPDATE:
I’m so thankful for your help!
Somehow my object had set itself to render as a trianglestrip, instead of a triangle list. I realise there’s no way you could have seen that, just leaving this here in case some fellow coder is stuck on the same strange issue!
Been looking into this for days now… live and learn!