color blending on render targets

Started by
4 comments, last by Schrompf 16 years, 3 months ago
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.
Advertisement
Moving to DirectX.
Do you have some code you can post so we can figure what's not working?

-programmer_tom
pDev->SetRenderState(D3DRS_ALPHABLENDENABLE, true);pDev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);pDev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);pDev->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);
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
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.
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.

This topic is closed to new replies.

Advertisement