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

Filling a rendertarget with alpha

Last post 1/16/2008 3:53 PM by FortisVenaliter Productions. 2 replies.
  • 1/16/2008 3:17 PM

    Filling a rendertarget with alpha

    I wanted to make a rendertarget and have it start out completely transparent befor I draw to it. When I set the rendertarget, I call GraphicsDevice.Clear and pass it (0,0,0,0) for the color. This fills the texture with black, not transparency.
    How do I get around this?

    FV
    Regards,
    Louis Ingenthron
    Fortis Venaliter
    Lead Developer of FV ProductionsFV Productions
  • 1/16/2008 3:35 PM In reply to

    Re: Filling a rendertarget with alpha

    Answer
    Reply Quote
    The result will still be black, just transparent black: you still have RGB values even if the alpha is set to zero.

    How are you then displaying the contents of this rendertarget? I would suspect that is where your problem lies, if it turns out opaque black.

    Or possibly your rendertarget format does not include an alpha channel?

    Best way to debug this sort of thing is use PIX to take a single frame capture, then look at exactly what color values are ending up in your rendertarget at any point you are interested in during the rending process.
    XNA Framework Developer - blog - homepage
  • 1/16/2008 3:53 PM In reply to

    Re: Filling a rendertarget with alpha

    Excellent, thank you!



    FV
    Regards,
    Louis Ingenthron
    Fortis Venaliter
    Lead Developer of FV ProductionsFV Productions
Page 1 of 1 (3 items) Previous Next