XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

3D AlphaBlending Problem

Last post 10/9/2007 12:10 PM by Shawn Hargreaves. 1 replies.
  • 10/9/2007 10:35 AM

    3D AlphaBlending Problem

    One of my models has a windshield with an alpha map, and when I do

    device.RenderState.AlphaBlendEnable = true;

    The windshield is partially transparent, like it should be, but when you look through the windshield, it causes the polygons that are facing the opposite direction (and perhaps some more?) to disappear, even though I did

    device.RenderState.CullMode = CullMode.None;

    Is there any way to fix this?

    Thank you,

    -Jeff

  • 10/9/2007 12:10 PM In reply to

    Re: 3D AlphaBlending Problem

    Answer
    Reply Quote
    You need to disable depth writes for your alpha objects, and draw them after your opaque objects.

    My colleague Eli wrote a good intro to alpha blending:

    http://blogs.msdn.com/etayrien/archive/2006/12/07/alpha-blending-part-1.aspx
    http://blogs.msdn.com/etayrien/archive/2006/12/12/alpha-blending-part-2.aspx

    This looks helpful, too:

    http://www.sjbaker.org/steve/omniv/alpha_sorting.html
    XNA Framework Developer - blog - homepage
Page 1 of 1 (2 items) Previous Next