Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Help on a Light pre pass renderer

4: Adsense

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   

517
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.


#2 nfactorial   Members   

735
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.