Plain node over terrain

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Tobi
Posts: 1
Joined: Tue Oct 27, 2015 12:59 pm
Location: .de

Plain node over terrain

Post by Tobi »

Hello!

I have a simple Terrain in irrlicht and I'd like to add a plain and simple node over it, (to cover a part of the terrain, for example with a different texture).
If this plain node has the same coordinates as the terrain element, I get a weird "combined display" of both textures. Z-Fighting, I guess.
How can I avoid this? Of course I could move the plain node a bit over the terrain, but aren't there better solutins? Isn't it possibile to somehow manually order element layers in the z-buffer?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Plain node over terrain

Post by CuteAlien »

Not something I worked at yet, but here's my thoughts: While it might be possible somehow by rendering in stages and not deleting the z-buffer in between - it's likely a bad idea. I'd try to use several textures on the same terrain-mesh and then write some material-shader combining them. Could be a little tricky when it comes to needing more than 2 uv-texture coordinates in Irrlicht (I heard the shader branch supports that already somehow, but again not something I've worked with).

A simpler trick could be to raise it more up. And then give it some border that goes into the floor. Won't work for completely flat floors obviously, but for real landscapes it's probably possible in most cases. Also the opposite works - lower the floor below objects (you might have seen those kind of holes in the floor maybe in mmorpg's when the level was still loading objects).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply