Textured model shows through non-textured model

In a basic program I’m working on, I can see an object with texture ‘through’ another object without texture. I can’t see the object without texture through the object with texture, though.



Here’s a screenshot:





The two object are simple cylinders (with hexagonal top/bottom), both exactly the same sizes (the textured appears smaller because it’s further away).



Any idea how this happened?

I don't think that this has anything to do with the texture. What zbuffer states are applied?

irrisor said:
I don't think that this has anything to do with the texture. What zbuffer states are applied?

I only set CullState.CS_BACK, but no zbuffer state. Shouldn't that be enough for basic rendering?

No without a zbuffer there is no distance check and what is displayed depends solely on the rendering order. Apply a zbuffer (e.g. like for the root node in SimpleGame) to solve your problem.



CS_BACK might even give you additional issues when your triangle winding is wrong, maybe you should leave that out for the beginning…

irrisor said:
CS_BACK might even give you additional issues when your triangle winding is wrong, maybe you should leave that out for the beginning...

Without CS_BACK I had the issue that i 'saw inside' the tubes (I essentially saw the back sides even where they should have been obscured by other parts of the same object).
Maybe adding a zbuffer fixes this, though :)

The reason you saw the insides of the tube was indeed due to not having a proper zbuffer state set for the same reason irrisor gave.