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

transparent problems

Last post 10/1/2007 5:41 PM by Pspfreak101. 3 replies.
  • 9/30/2007 7:53 PM

    transparent problems

    I need help having my explosions being transparent i tried using Additive blending but it only shows up on a black background tried using photoshop but it turns out spotchy.  Any other way I can make it transparent? Heres my explosion
  • 10/1/2007 12:59 AM In reply to

    Re: transparent problems

    device.RenderState.AlphaBlendEnabled = true;
    device.RenderState.SourceBlend = Blend.SourceAlpha;
    device.RenderState.DestinationBlend = Blend.One;

    I don't have the code in front of me, but I'm pretty sure it is something like that. Just set your renderstate before you draw.

    The 3D particle sample in the samples section uses some particles with black backgrounds. You could check that out.

    XNA QuickStart Engine (3D Game Engine for XNA) | My site
    "I'll be whatever I want to do!", Philip J. Fry
  • 10/1/2007 1:37 AM In reply to

    Re: transparent problems

    I'm not quite sure what you mean by 'spotchy', but I think the best way to go about this is to give the image an alpha channel using Photoshop. If you're not all that familiar with the ins and outs of the program, here's a brief how-to:

    After loading the image select the entire image using the marquee tool and copy it to the clipboard. In the layers tab right-click on the background and choose 'Layer from Background...'. Then click the 'Add layer mask' button at the bottom of layers tab. Go to the channels tab and make only the mask channel visible, then paste the image from the clipboard.

    I'd also recommend changing the black areas of the image red otherwise you may end up with a pale black halo around your explosions.

  • 10/1/2007 5:41 PM In reply to

    Re: transparent problems

    thanks works perfectly now :)
Page 1 of 1 (4 items) Previous Next