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].AlphaBlendOperation = BlendOperation.Add;
desc.RenderTarget[0].BlendOperation = BlendOperation.Add;
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;
desc.RenderTarget[0].RenderTargetWriteMask = ColorWriteMaskFlags.All;
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