Jump to content

  • Log In with Google      Sign In   
  • Create Account


[SOLVED] For Physical BRDFs, why use such high specular powers (eg. 8192)?


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

#1 n00body   Members   -  Reputation: 265

Like
0Likes
Like

Posted 20 December 2013 - 06:02 PM

Background

So I have been looking into physically-based BRDFs for some time now, and have observed a perplexing trend. The companies that post the papers always seem to use a ridiculously high specular power (eg. Treyarch for COD BO uses 8192 for lights, 2048 for environment maps) when using a Normalized Blinn Phong NDF. This seems strange to me, especially since I have read that these powers are for extremely rare, super-polished mirror surfaces. Also, it means that they have to store a high-res mip level in their prefiltered environment maps that will take up a lot of space but almost never get used.

 

Up until now, I have usually settled for a maximum spec power of 1024 for my analytical lights, and 256 for my environment maps. For my bloom, I have been using a threshold of 1.0 and additive blending (what Unity provides). 

 

Problem

Whenever I test these specular powers myself, it causes the resulting specular highlight intensity to shoot up so high that my bloom goes crazy. In particular, as my camera moves I get very distracting flashes of bright spots on sharp model edges that appear and disappear in a very annoying way. 

 

Questions

1.) What is the incentive for using such high powers?

2.) Am I doing my bloom theshold wrong, and should I move it up?

3.) Is this a consequence of the Bloom blending mode?

 

Any help would be most appreciated.


Edited by n00body, 24 December 2013 - 10:29 PM.


[Hardware:] Windows 7, Nvidia Geforce GT 440, AMD Athlon II X4 620, 6GB RAM

[Websites:] Development Blog | LinkedIn
[Unity3D :] Alloy Physical Shader Framework | Free RNM Shaders


Sponsor:

#2 Hodgman   Moderators   -  Reputation: 27009

Like
2Likes
Like

Posted 20 December 2013 - 11:12 PM

For phong/Blinn style specular, where high powers == smooth surfaces, a mirror has a power value of infinity. A power value of 10k is actually still fairly blurry compared to a mirror.
They use this as their maximum power value so they can have polished materials. Stuff like (undamaged) chrome or glass are likely candidates for those values.

As for your bloom filter, what does 1.0 mean for starters? What units is that in, and what's the significance?
More to the point -- this type of bloom filter is not based on physics/reality and is just a made up effect, so there's no right answer other than 'fiddle with it'.
A realistic bloom shouldn't have a threshold at all -- a threshold is saying that the lens is perfect for low-intensity objects but imperfect for high intensity ones!!

Lastly, what kind of tonemapper are you using, and what range of intensity values do you use?
I found that when using an intensity range similar to human perception (~12 orders of magnitude or 0 to 2^12) and a logarithmic tone-mapper, then thresholdless bloom filters suddenl looked ok, whereas before they looked overpowering...

#3 MJP   Moderators   -  Reputation: 10106

Like
4Likes
Like

Posted 21 December 2013 - 01:16 AM

Smooth surfaces certainly aren't "super rare" in most games. That category includes metals, standing water, polished ceramics, and glass.

The problem you're describing with the flickering bloom sounds like a symptom of shader aliasing. When you shade a surface with a pixel shader, you end up calculating reflectance for an infinitesimally small patch of that surface located at the center sample point of the pixel. When using high specular powers, the specular reflectance becomes very high-frequency, which means its intensity can change very rapidly as either the view angle, light angle, or normal direction changes. When the camera moves or the object moves, the sample point in the center of a pixel ends up covering a different point on the surface, which can cause the shading to change rapidly. This is particularly true when the normals of the surface also change rapidly, for instance when using a highly-detailed normal map. In a more realistic simulation you wouldn't shade an infinitely small point on a surface, you would integrate over the entire portion of surface that the pixel covers. Doing such an integration would naturally filter out the high-frequency flickering, and prevent aliasing. This isn't really practical for games, so currently they resort to cheaper approximations. Most of them are based around the idea of adjusting the roughness (specular power) based on the amount of normal map detail that's covered by a single pixel. It can also be possible to supersample to a limited extent, which can reduce the aliasing. Usually this is done with temporal techniques, that try to re-use one or more samples from previous frames.



#4 n00body   Members   -  Reputation: 265

Like
0Likes
Like

Posted 24 December 2013 - 10:29 PM

@Hodgman

Well one thing I discovered was that I made the faulty assumption that my team's artist added a tonemapper at all. Needless to say, adding that helped a lot. I am just using the Bloom and tonemappers that ship with Unity. The 1.0 cutoff just means anything above 1.0 in intensity contributes to bloom. And we are using the "Photographic" setting for the tonemapper. 

 

@MJP

Yeah, I figured it was probably mostly because of aliasing, but I was reluctant to go down that path so soon since Unity has absolutely awful support for custom mipmaps. I did manage to get it to work, and it helped a lot. 

 

@all

So yeah, I now understand the point of such high spec powers for up close smoothness. At a distance, the precomputed specular AA makes it appropriately more rough. 

 

Thanks. 



[Hardware:] Windows 7, Nvidia Geforce GT 440, AMD Athlon II X4 620, 6GB RAM

[Websites:] Development Blog | LinkedIn
[Unity3D :] Alloy Physical Shader Framework | Free RNM Shaders





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