Texture switching

I'm working with variations of the JOGL version of the NeHe tutorial 10. I have incorporated Andrew Davison's obj loader and am rendering an object from a Display List. I am drawing the object's shape but am not getting the object's texture and materials properties. The NeHe tutorial uses textures loaded from a png file when rendering the walls, floors and ceilings. The object I am drawing after the topography has been created does not display it's textures. When I attempt to turn off the currently bound texture with gl.glBindTexture(GL.GL_TEXTURE_2D, 0); .. I see the object without any color at all, it's white. How do I get the gl to disregard the textures from drawing the topography and have it render the object in the display list with the materials defined in the mtl file that goes with the obj file. Note that the same object is rendered OK in a scene where there hasn't been any bound textures.

Thanks for any hints ... doktat

[963 byte] By [doktata] at [2007-11-26 20:20:24]
# 1

In your post, you implied that you were using display lists to also handle the material code. In my programs I ran into an interesting problem with display lists and materials. Only the last material would ever be considered when I would have multiple meshes with different properties.

I never bothered to find the solution because switched from display lists to VBO's for more flexibility, but you could try keeping the material and texture code out of your display list. That part has fairly low overhead to actually drawing the mesh.

m_ludwiga at 2007-7-10 0:44:50 > top of Java-index,Other Topics,Java Game Development...