Skip to main content
GameDev.net gamedev.net
🔒 Locked

Opacity

Started by whereisumar May 24, 2006 at 7:07 PM 0 replies 550+ views
Original Post
whereisumar
whereisumar
Hi, How do you define a materials opacity in c# with D3D 9?
Staffan E
Staffan E
There are three major ways to supply alpha data (opacity/visibility) to a rendered primitive in DirectX. The first is to set the vertex color alpha component to the desired alpha value for each vertex. The second is, if you use materials and lights, to set the alpha in the material diffuse color. The third is, if you use a texture with you primitives, to retreive the alpha from the texture assuming it contains alpha data at all.

Whichever method you use to supply alpha you need to turn on Device.RenderState.AlphaBlendEnable to enable alpha blending in your scene.

Check out this page in the MDX docs for an introduction to alpha blended rendering.
Hack my projects! Oh Yeah! Use an SVN client to check them out.BlockStacker

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.