Transparency rendering order.

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Transparency rendering order.

Post by agamemnus »

For my water scene node in my game, I have thought of this setup:

Starting with:
1) A rectangular plane with 50% transparency -- sea/water texture.
... then (level or z-position is the same):
2) A rectangular plane with 25% transparency -- sea/water texture.
... then: (level or z-position is the same):
3) Flat polygons ("areas") representing different areas in my game, plus roads and outlines.
... then:
4) Various 3D objects.

Those first two planes (water planes) are moving in their texture coordinates at slightly rates, creating a decent water effect. The problem is that there is no way I can put them on the same plane with my area polygons without either causing z-fighting or (if I disable zwrite for either or both) without causing the water textures to just flow over the area textures.

What I'm doing right now is slightly offsetting the sea/water texture by 1 point. But this doesn't look good close up, since you can tell that the land is "raised" and there's z-fighting far away. (albeit very far)

So, I guess what I need is a transparent EMT_SOLID... :D
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Well, I've had to do something like this. I did what you said didn't work though, I rendered the lowest layer without z-write, then rendered the one above it with z-write. Worked perfectly fine for me.
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

I haven't been able to come up with any working combination of zbuffer/zwrite enable. Can you tell me specifically of the two water nodes and the area nodes which should have zbuffer/zwrites on/off?

Edit: I also just realized that the first and second sea nodes are still z-fighting because they are on the same plane, despite that they are both transparent.

Edit: whatever rendering order works.. I'm not picky. But.. I don't think with the current system there's any order that works. I tried many combos with zwrite and I don't really see any effect. IDK.
Post Reply