Trying to get transparent DIFs
by Ian Omroth Hardingham · in Torque Game Engine Advanced · 04/19/2008 (9:34 am) · 4 replies
Hey guys.
Excuse me for being noob on this one - I'm only just starting with gfx coding and my knowledge is pretty small.
I'm trying to enable full translucency for DIFs. I'm using this pixel shader (no vert shader):
With these dbs:
This works fine looking from one direction:

But not from the other:

I'm seriously new to this guys, so as much advice as possible would be helpful.
Cheers,
Ian
Excuse me for being noob on this one - I'm only just starting with gfx coding and my knowledge is pretty small.
I'm trying to enable full translucency for DIFs. I'm using this pixel shader (no vert shader):
float4 main() : COLOR0
{
float4 color;
color[0] = 0.2;
color[1] = 0.0;
color[2] = 0.8;
color[3] = 0.4;
return color;
}With these dbs:
new ShaderData( HomeBoyShader )
{
DXVertexShaderFile = "shaders/homeBoyV.hlsl";
DXPixelShaderFile = "shaders/homeBoyP.hlsl";
pixVersion = 2.0;
};
new CustomMaterial( HomeBoy )
{
mapTo = "Cyan";
texture[0] = "scriptsAndAssets/data/interiors/CYAN"; // bumpmap texture in texture unit 0
translucent = true;
BlendOp = LerpAlpha;
translucentBlendOp = LerpAlpha;
translucentZWrite = true;
attenuateBackFace = true;
shader = HomeBoyShader;
version = 2.0;
};This works fine looking from one direction:

But not from the other:

I'm seriously new to this guys, so as much advice as possible would be helpful.
Cheers,
Ian
About the author
Designer and lead programmer on Frozen Synapse, Frozen Endzone, and Determinance. Co-owner of Mode 7 Games.
#2
Ian
04/19/2008 (10:09 am)
It appears that turning translucentzwrite off fixes it... no idea why, but it appears to work.Ian
#3
04/25/2008 (6:05 am)
Turning zwrite off fixes it because the farther one is drawn last from this direction, and is getting rejected by the zbuffer (because the closest one drew first, and filled in the zbuffer with closer values).
#4
05/06/2008 (9:43 am)
Hi Ian... please keep this updated with your progress, there is a lot of people that need it ;)
Associate Ian Omroth Hardingham
Mode 7 Games