February 16, 2005, 6:27pm
I have loaded a few models into a scene. Each model uses a different texture including the floor which has a green texture.
The problem I am having is that as I navigate round objects and move to the left or right, suddenly the object texture changes to the one I used for the floor.
Its a very odd behaviour which doesnt go away even when I do
TextureState modTex = display.getRenderer().createTextureState();
Texture tr = TextureManager.loadTexture(
does anybody know whats going on?
February 16, 2005, 6:40pm
Can you provide a simple example for testing?
February 16, 2005, 6:51pm
this would take me a little time as the code is a bit big and messy. I will try to get something for you. btw am I doing all the right things here? my understanding of textures is near zero.
February 16, 2005, 7:07pm
from the code you posted it looks fine, but it’s a small sample… Are you calling updateRenderState on i or a tree ancestor of i?
February 16, 2005, 7:19pm
good point as I dont do this. do I call it in the update method or as soon as I create the node?
February 16, 2005, 7:58pm
You call it whenever states change on the scenegraph. typically you call it once on the root node at the end of setting up your scene (done for you if you use SimpleGame) then you’d only need to call it again if you change states around like swap in a new texture, etc.
February 16, 2005, 9:44pm
ok, I will add this and see what change does it make.
February 16, 2005, 11:41pm
Thx renanse. I was missing the updateRenderState. It seems to be working ok now.