Z-order problem with alpha terrain

Blitz3D Forums/Blitz3D Programming/Z-order problem with alpha terrain

Hi,

I'm having a problem with a terrain editor I've been messing around with. I'm trying to use vertex alpha blending to make a smooth transition from one texture to another by having a different surface for each texture and fading them in and out.

To do this I have to enable EntityFX 32 for all the terrain meshes (my terrain is made up of many different meshes tiled together) which causes z-order problems.

I've heard of people using a bottom surface that's just all white or some solid color to fix this problem but I've tried that and it doesn't seem to work. Any suggestions?

make the base layer +2 not 32+2

Ie:
---ALPHA+color
---ALPHA+color
---ALPHA+color
---ALPHA+color
---Color only

Also, the order you create the surfaces matters as well (assuming you are using a multi surf mesh)

Thanks for the reply, but I can't seem to find a way to apply different effects to different surfaces. Should I use BrushFX? Because when I do EntityFX 32+2 it just applies to the whole mesh.

Thanks ahead of time.

Yes, use BrushFx and paintsurface.

Thanks for the advice it works nicely. Just out of curiosity, though, is there a more efficient way of fixing this problem without adding a whole extra surface? It seems kind off unoptimized to use a whole extra surface just for this purpose.

Not on the base layer as it always needs to be solid, but for the others, when creating the end result, you can copy the mesh vertex data to a new createmesh() mesh, with the exception of any triangles where all 3 verts are <0.01 alpha (as theres no point in them being there).

Thanks for all the help.