Jump to content

  • Log In with Google      Sign In   
  • Create Account


Alphablending with floating point render targets


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 flip_mo_kid   Members   -  Reputation: 151

Like
0Likes
Like

Posted 21 May 2005 - 05:05 AM

Hi, I was alpha blending a render surface with a texture so that the output would be one multiplied by the other. I have now changed the format from standard to floating point and the alphablending code no longer works. Can someone help me fix this as I'm not sure what to do. Thanks

		Device->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, 0);//Use first(and only) UV
		Device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);//Just take texture, we don't want lighting or anything.
		Device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
		Device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
		Device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
		Device->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
		Device->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
		
		// blend as newcolor * previouscolor + previouscolor * 0
		Device->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
		Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_DESTCOLOR);
		Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO);
		Device->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);

		Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0);
		(*renderSurface[j])->BeginScene(*textureSurface[j], NULL);

		Device->SetStreamSource(0, texVQuad, 0, sizeof(TexVertex));
		Device->SetIndices(texIQuad);
		Device->SetFVF(TexVertex::FVF);
					
		Device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 4, 0, 2);	
		(*renderSurface[j])->EndScene(0);



Sponsor:

#2 SimmerD   Crossbones+   -  Reputation: 1098

Like
0Likes
Like

Posted 21 May 2005 - 07:38 AM

Most cards don't support alpha blending to fp render targets. Currently, only the GeForce 6600+ cards support blending to a16r16f16b16f fp format.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS