Followers 0

# Help on a Light pre pass renderer

## 1 post in this topic

Hey .

I am developing a simple graphics engine using SharpDX . I decided to use Light Pre Pass method for lighting.

I'm using a light buffer with the format R16G16B16A16_Float . It's working ok until I use speculars .

I am using a Blend state like this :

BlendStateDescription desc = new BlendStateDescription();
desc.AlphaToCoverageEnable = true;
desc.RenderTarget[0].DestinationAlphaBlend = BlendOption.One;
desc.RenderTarget[0].DestinationBlend = BlendOption.One;
desc.RenderTarget[0].SourceAlphaBlend = BlendOption.One;
desc.RenderTarget[0].SourceBlend = BlendOption.One;
desc.RenderTarget[0].IsBlendEnabled = true;
BlendState state = new BlendState(Graphics.GraphicsRenderer.device, desc);

so when I am writing to Light Render Target , When I write  :
return saturate(float4(NdotL*att*LightColor,1.0f));
it's ok. When I write :
return saturate(float4(NdotL*att*LightColor,0.5f));

But suddenly when I write :
return saturate(float4(NdotL*att*LightColor,0.4f));

It's all dark now !
Thanks in advance and sorry for my poor English
Edited by BlackBrain
0

##### Share on other sites

You shouldn't have AlphaToCoverage enabled. Change to:

desc.AlphaToCoverageEnable = false;


n!

2

## Create an account

Register a new account