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

Problem Transparent RenderTarget Texture

Started by Tradematrix Aug 26, 2003 at 12:36 PM 3 replies 800+ views
Original Post
Tradematrix
Tradematrix
I Work with C# & DirectX 9 i create a texture with Usage.RenderTarget then i use Device.SetRenderTarget to set my texture surface 0 for render then i render something in the texture with Sprite.Draw i want the base color of my texture Transparent ! how can i do that if i make Device.Clear(D3D.ClearFlags.Target,Color.FromArgb(255,Color.Blue),1.0f,0); the part that must be transparent are blue ! this is my AlphaBlend RenderState : RenderState.AlphaBlendEnable = true; RenderState.SourceBlend = D3D.Blend.SourceAlpha; RenderState.DestinationBlend = D3D.Blend.InvSourceAlpha; can someone tell me method to do a transparent texture please.
Tommyboy
Tommyboy
send me your email address and I''ll email an example VS.NET 2003 solution.

Tommyboy
Tommyboy
janos
janos
in what format have you created your render target?
Act of War - EugenSystems/Atari
Tommyboy
Tommyboy
I am using Managed DX9, and D3D for sprites not DirectDraw.

I also am not creating Primary/Secondary surfaces in code. I believe that windowed devices automatically create the primary surface for you.

I sent an email with project to you.

Tommyboy
Tommyboy
Tommyboy
Tommyboy
BackBufferFormat is : X8R8G8B8

By the way,

Device.Clear(D3D.ClearFlags.Target,Color.FromArgb(255,Color.Blue),1.0f,0);

clears the render target to blue, if the sprite transparent color is not blue, then what you are describing is supposed to happen. To test if transparency is really working, create multiple sprites at various locations on your screen. Move one of your sprites around the screen, preferably over the top of other sprites. If transparency is not working you should be able to tell.

Tommyboy

[edited by - Tommyboy on September 6, 2003 5:27:36 AM]
Tommyboy

Topic Locked

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

Sign in to reply to this topic.