Alpha texture issue ??? [SOLVED]

Coolzero

05-04-2010 16:35:05

Hi there,
can some one help me to fix this 'bug' ?

Gras and grid are two seperated objects. The position of the gras is 0, 0, 0 and the grid position is 0, 0.2, 0.

Why can i see the grid through the house ???

here is my material code:

material Mat_Raster
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_check off

texture_unit
{
texture Raster.png
}
}
}
}

smiley80

05-04-2010 17:02:16

Cause you've turned depth check off.
Removed that line:
depth_check off

Coolzero

05-04-2010 17:21:55

Hi smiley80,

when i remove this line depth_check off,
this is the result :) :

smiley80

07-04-2010 20:00:38

How do you create the entity/mesh of the grid?

mstoyke

08-04-2010 01:21:42

Change the render queue for the grid to a higher value (e.g. RENDER_QUEUE_WORLD_GEOMETRY_2), this should solve the problem.

Currently the grid is rendered first, writing to the Z-Buffer and the later rendered grass object will just be Z-culled. This is also a common problem for transparent objects (alpha blending).

Coolzero

08-04-2010 08:10:00

@smiley80
The grid is just a simple plane (Dim Grid As Entity = myScene.CreateEntity("Grid", "Grid.mesh"))


@mstoyke
thanks, that's solving the problem :D

I set the RenderQueue for terrain (gras) and the grid to RenderQueueGroupID.RENDER_QUEUE_1,
and for the building RenderQueueGroupID.RENDER_QUEUE_2. This works perfect, THANK YOU.