Original Post
I am making a dx9 ao shader.
I have the ao greyscale image in a texture, and the rendered scene in the backbuffer.
What blendmodes (dx9 fixed function pipeline) would I need to multiply the ao texture against the backbuffer.
something like this : backbuffer=backbuffer*aotexture
I currently have the following, but it is not blending with the backbuffer.
gRender->SetRenderState(D3DRS_ALPHABLENDENABLE,TRUE);
gRender->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
gRender->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCCOLOR);
gRender->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
gRender->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
gRender->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
gRender->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2 );
gRender->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
Is it even possible to blend a texture with the existing backbuffer?
Thanks
I have the ao greyscale image in a texture, and the rendered scene in the backbuffer.
What blendmodes (dx9 fixed function pipeline) would I need to multiply the ao texture against the backbuffer.
something like this : backbuffer=backbuffer*aotexture
I currently have the following, but it is not blending with the backbuffer.
gRender->SetRenderState(D3DRS_ALPHABLENDENABLE,TRUE);
gRender->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
gRender->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCCOLOR);
gRender->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
gRender->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
gRender->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
gRender->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2 );
gRender->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
Is it even possible to blend a texture with the existing backbuffer?
Thanks