• Advertisement
Sign in to follow this  

Specular Control

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

gallery_1_371_501762.jpg

 

In this image you see our current setup on the left. The issue is that speculars are not blocked by objects that are in the direct path of the light. One might suggest that shadows could fix this, but the issue is that the shadows only cause the specular to be less intense but does not remove the specular from the blocked areas. Is there some way to fix this?

Share this post


Link to post
Share on other sites
Advertisement

I'm not aware of any technique to fix these kinds of issues without using a global illumination system.

 

I have seen dark lights (a light source that will decrease the intensity of the lighting (or only the specular) within its radius) to improve this problem but it doesn't take it completely away (and you need to place those lights or write an automatic system).

 

Perhaps you could modify SSAO? Instead of 'just darkening the corners', you could use this value to modify the specular.

Edited by Yourself

Share this post


Link to post
Share on other sites
You will need to separate the direct and ambient light contributions. The specular only comes from the direct part, so if that is blocked specular should be removed completely.

Share this post


Link to post
Share on other sites
How do you do that with a deferred renderer? Ambient and diffuse are precombined.

Share this post


Link to post
Share on other sites
It makes no difference with a deferred renderer. Specular is calculated from each direct light before they are combined with the diffuse channel.

There is another, different way to get it wrong with deferred shading, which is to add specular lighting to the diffuse buffer, which means it gets multiplied by the albedo, but that's not what's happening here.

Edit: I'm referring to deferred lighting above. Full deferred shading does not combine lights into a buffer.

Share this post


Link to post
Share on other sites
They're calculated separately but at the point of calculation you don't have the shadow information to determine if the specular should be added or not. It's not until the final composite stage that you have that data, at which point specular and ambient are already combined.

Share this post


Link to post
Share on other sites

They're calculated separately but at the point of calculation you don't have the shadow information to determine if the specular should be added or not. It's not until the final composite stage that you have that data, at which point specular and ambient are already combined.


In that case, I can only suggest doing the lighting calculations in a different way so that shadowing information is available. This isn't normally an issue with deferred lighting.

Share this post


Link to post
Share on other sites
Can you post shadowing code? It should be done when lighting is done.

Share this post


Link to post
Share on other sites
Ah, so the shadows are supposed to be added into the lighting buffer output apparently. Since I wasn't the one who set this up originally I hadn't really done much research into the compositing stage of shadows, so I just assumed it was normal to add them in during the final gbuffer pass. Thanks for the help guys.

Share this post


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

  • Advertisement