• Advertisement
Sign in to follow this  

color blending on render targets

This topic is 3668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am having trouble with directx. I want to blend colors on render targets. So that if i render a blue pixel rgb(0,0,1) onto a green pixel rgb(0,1,0) the resultant pixel should be rgb(0,1,1); Is there any way to do this in shaders.

Share this post


Link to post
Share on other sites
Advertisement
pDev->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
pDev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
pDev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
pDev->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);

Share this post


Link to post
Share on other sites
I want to know if there is anyway to add colors like alpha.
When I draw something, lets say a sprite with a 0.5 alpha value on top of another one, the transperancy decreases and the image starts becoming opaque.
Is there anyway to do the same with colors.
Thanks

Share this post


Link to post
Share on other sites
See Namethatnobodyelsetook's response. Plus enabling AlphaBlending by setting the corresponding renderstate. Beware that alpha blending isn't supported on every rendertarget format and every graphics card. All but the most recent graphics boards are unable to alphablend when rendering to a floating point rendertarget.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement