Results 1 to 2 of 2

Thread: Help making a render target transparent

  1. #1

    Help making a render target transparent

    I'm making this:



    I want to make the black area transparent, and I need help. What I'm doing is drawing the 3D red cylinder in a texture, using setRenderTarget. The texture is created this way:

    Code:
      D3DXCreateTexture(_scene.device, _width, _height, 1,
        D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, _texture);
    To draw on it I use:

    Code:
    ...
        _texture.GetSurfaceLevel(0, surf);
        _device.SetRenderTarget(0, surf);
      end;
    
      _device.Clear(0, nil, D3DCLEAR_TARGET or D3DCLEAR_ZBUFFER, _backColor,
        1.0, 0);
    ...
    The I use a ID3DXSprite instance to draw the texture in the screen, so it is placed in the right level of the graphical interface.

    Setting the back color's alpha = 0 doesn't make the background transparent, as I supposed. Is there a way to make the rendering texture's background transparent? I have no clue what to do.

    I would really appreciate any help on this.

  2. #2

    Help making a render target transparent

    I found the problem myself, I was using a XRGB color instead of ARGB :lol:

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL