Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
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

Specular Control

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
8 replies to this topic

#1 riuthamus   Moderators   

8347
Like
0Likes
Like

Posted 27 February 2013 - 09:28 PM

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?



#2 Yourself   Members   

1935
Like
1Likes
Like

Posted 28 February 2013 - 03:22 AM

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, 28 February 2013 - 03:23 AM.


#3 EWClay   Members   

659
Like
2Likes
Like

Posted 28 February 2013 - 03:26 AM

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.

#4 Telanor   Members   

1486
Like
1Likes
Like

Posted 28 February 2013 - 04:04 AM

How do you do that with a deferred renderer? Ambient and diffuse are precombined.

#5 EWClay   Members   

659
Like
1Likes
Like

Posted 28 February 2013 - 05:29 AM

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.

#6 Telanor   Members   

1486
Like
0Likes
Like

Posted 28 February 2013 - 05:12 PM

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.

#7 EWClay   Members   

659
Like
1Likes
Like

Posted 28 February 2013 - 05:32 PM

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.

#8 kalle_h   Members   

2463
Like
1Likes
Like

Posted 01 March 2013 - 02:13 PM

Can you post shadowing code? It should be done when lighting is done.

#9 Telanor   Members   

1486
Like
1Likes
Like

Posted 01 March 2013 - 06:46 PM

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.




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.