How to get transparent mesh

Started by
1 comment, last by pcwlai 18 years, 2 months ago
Hi I have a tree mesh with a texture with alpha channel. Which renderstates should I use to get the alpha channel to be transparent?
Casual game dev www.apgames.se
Advertisement
Device.RenderState.SourceBlend = Blend.SourceAlpha;
Device.RenderState.DestinationBlend = Blend.InvSourceAlpha;
Device.RenderState.AlphaBlendEnable = true;

I hope this helps.
Take care.
If you have no alpha channel in the render target (including your frame buffer), you can set the source alpha to SRCALPHA and destination to INVSRCALPHA or ONE.

If you have alpha channel in the render target, you can set the source alpha to SRCALPHA and destination to DESTALPHA.

The best way is to experientment with the alpha blending settings by your self to archieve what you really need. As with the whole mesh transparent, you can choose to disable back face culling to make it sees both sides of the mesh.
The poorest programmer in the game industry!!

This topic is closed to new replies.

Advertisement