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

"Render Target" format

Started by mohandes_philip Dec 1, 2008 at 10:29 PM 3 replies 1.3k views
Original Post
mohandes_philip
mohandes_philip
hi for enabling alpha blending for a render target what format must be set...? thank you.
MJP
MJP
You can set any format for which the device supports alpha-blending. In D3D9 you query the device with a specific format, to see whether it supports post-pixel-shader blending operations.
mohandes_philip
mohandes_philip
let me explain my problem . I do these jobs:

1 - create a 100x100 texture with RENDER_TARGET usage.
2 - set render target as previous texture surface.
3 - clear target with a transparent color (Ex. 0x00FF00F0)
4 - get render target texture and assign it to a quad.
5 - change render target to front buffer and render quad to it
with D3DRS_SRCALPHA and D3DRS_DESTINVSRC render states.

after above processes when i present device i saw a 100x100 quad on screen!
because i clear render target to a transparent color it must be no
quad on screen.

Can you help me...?

Thanks.
ET3D
ET3D
Quote:
Original post by mohandes_philip
5 - change render target to front buffer and render quad to it
with D3DRS_SRCALPHA and D3DRS_DESTINVSRC render states.

Do you mean: Set D3DRS_SRCBLEND to D3DBLEND_SRCALPHA and D3DRS_DESTBLEND to D3DBLEND_INVSRCALPHA? If not, then that might be the problem.


mohandes_philip
mohandes_philip
Quote:
Original post by ET3D
Quote:
Original post by mohandes_philip
5 - change render target to front buffer and render quad to it
with D3DRS_SRCALPHA and D3DRS_DESTINVSRC render states.

Do you mean: Set D3DRS_SRCBLEND to D3DBLEND_SRCALPHA and D3DRS_DESTBLEND to D3DBLEND_INVSRCALPHA? If not, then that might be the problem.


yes.

Topic Locked

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

Sign in to reply to this topic.