Jump to content
  • Advertisement
Sign in to follow this  
AmidaBucu

Alpha Blend

This topic is 3604 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

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]

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!