alpha channel problem

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
irrlichtler
Posts: 2
Joined: Thu Apr 23, 2009 12:03 pm

alpha channel problem

Post by irrlichtler »

hello!
I have a problem with a material. I created a hlsl shader material based on the material EMT_TRANSPARENT_ALPHA_CHANNEL. Within the shader I set the alpha value of the output color to a static value between 0 and 1. The problem is that sometimes you can see through the surface rendered with the shader and sometimes it isn't transparent. It seems that this problem depends on the rotation of the camera. Can you help me?
mk.1
Posts: 76
Joined: Wed Oct 10, 2007 7:37 pm

Post by mk.1 »

Maybe if you post your code? :?
irrlichtler
Posts: 2
Joined: Thu Apr 23, 2009 12:03 pm

Post by irrlichtler »

I add the shader material:

gpu->addHighLevelShaderMaterialFromFiles(
G_XFXBASE, "VS", video::EVST_VS_2_0,
G_XFXBASE, "PS", video::EPST_PS_2_0,
baseShaderAlphaInst, video::EMT_TRANSPARENT_ALPHA_CHANNEL);

Code in the shader to set the alpha value:

struct VSOut
{
float4 pos : POSITION0;
float4 diff : COLOR0;
float2 texColor : TEXCOORD0;
};
...
...
PSOut PS(VSOut In)
{
PSOut Out;
...
...
Out.color.a = 0.7f;
return Out;
}
Post Reply