first of all, I have to mention, that I'm using the Irrlicht .Net CP Wrapper - that's why I'm not sure if I should post in this forum, the .Net forum or directly over at the CP forum...so sorry if I'm in the wrong place here
Being inspirated by IrrEdit, I currently working on a selfmade map editor using Irrlicht.
I recently implemented the functionality to apply textures to a given model, which works fine.
My problem now is, that right after I apply the new texture, something gets all screwy with the ZBuffer, which is best shown with these two screenshots:
This is a screenshot of the model, with the original texture, that's automatically being loaded, when the model is loaded:
Everything is looking good...take notice of the movement tool, which is rendered with ZWrite disabled, so that it's always on top.
Now after applying the new texture the scene looks like this:
Notice, that the movement tool is not on top anymore.
The piece of code, that causes that behaviour looks like this:
Code: Select all
Node.SetMaterialTexture((int)TextureLayerID.Value-1, Device.VideoDriver.GetTexture(ListViewTextures.SelectedItems[0].Tag.ToString()));
I don't really have any idea what could go wrong here.
Can anyone help?
Thanks a lot in advance.
Greets