Alpha Blend

Started by
0 comments, last by AmidaBucu 15 years, 4 months ago
Hi there! I want to try out the wolf's light pre pass rendering. And I don't know how to blend light datas into one texture. I did is so in my "engine":

	ClearTexture(c_RT3);
	SetRenderTarget(0, c_RT3);
	
	c_shaderStoreLight->SetTexture("lights", c_RT3);
	c_shaderStoreLight->SetTexture("normals", c_RT1);
	c_shaderStoreLight->SetTexture("depths", c_RT0);
	c_d3d->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
	c_d3d->SetRenderState(D3DRS_SRCBLENDALPHA, D3DBLEND_ONE);
	c_d3d->SetRenderState(D3DRS_DESTBLENDALPHA, D3DBLEND_ONE);
	for(int i = 0; i < c_light.Size(); i++)
	{
		c_d3d->BeginScene();
		c_shaderStoreLight->Begin(NULL, NULL);
		c_shaderStoreLight->SetVector("lightPos", (D3DXVECTOR4*)&c_light.c_pos);
		c_shaderStoreLight->SetVector("lightDiff", (D3DXVECTOR4*)&c_light.c_diff);
		c_shaderStoreLight->CommitChanges();
		c_shaderStoreLight->BeginPass(0);
		DrawScreenPlane();
		c_shaderStoreLight->EndPass();
		c_shaderStoreLight->End();
		c_d3d->EndScene();
	}




In that way I can't get the right result I want. Does Anyone know how to put the all of the lights into the light buffer? How to tell the shader not to overwrite, but blend the new color woth the old one? [Edited by - AmidaBucu on December 2, 2008 6:29:20 AM]
Advertisement
I just dunno, how to blend a texture and the result of a pixelshader

This topic is closed to new replies.

Advertisement