Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Help on a Light pre pass renderer


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 BlackBrain   Members   -  Reputation: 359

Like
0Likes
Like

Posted 13 January 2014 - 03:19 AM

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

Edited by BlackBrain, 13 January 2014 - 04:16 AM.


Sponsor:

#2 nfactorial   Members   -  Reputation: 731

Like
2Likes
Like

Posted 13 January 2014 - 06:50 AM

You shouldn't have AlphaToCoverage enabled. Change to:

 

desc.AlphaToCoverageEnable = false;

 

n!






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