How do you think the cavity parameter in the Unreal Engine 4 material model is used. The course notes say it describes small shadows. In what way is it different from baking AO into the color texture for example?
Cavity in UE 4
Members - Reputation: 685
Posted 04 November 2013 - 07:02 AM
According to course notes the cavity is simply a factor which affects the highlight intensity directly. Cavity basically models very small scale AO as far as I know.
Do you remember where you read that? I cannot find the part about affecting the highlight intensity in the these course notes. Does it only affect the highlights or the diffuse lighting as well?
Members - Reputation: 1843
Posted 04 November 2013 - 08:06 AM
It should theoretically also affect the diffuse part, but the notes say nothing explicitly about that.
BaseColor, Metallic, and Roughness are all the same as Disney’s model, but Cavity parameter wasn’tpresent, so it deserves explanation. Cavity is used to specify shadowing from geometry smaller thanour run-time shadowing system can handle, often due to the geometry only being present in the normalmap. Examples are the cracks between ﬂoor boards or the seams in clothing.The most notable omission is the Specular parameter. We actually continued to use this up untilthe completion of our Inﬁltrator demo, but ultimately we didn’t like it. First oﬀ, we feel “specular” isa terrible parameter name which caused much confusion and was somewhat harmful to the transitionfrom artists controlling specular intensity to controlling roughness.Artists and graphics programmersalike commonly forgot its range and assumed that the default was 1, when its actual default was Burley’s 0.5 (corresponding to 4% reﬂectance). The cases where Specular was used eﬀectively were almostexclusively for the purpose of small scale shadowing. We found variable index of refraction (IOR) to befairly unimportant for nonmetals, so we have recently replaced Specular with the easier to understandCavity parameter. F0 of nonmetals is now a constant 0.04.
Edited by Bummel, 04 November 2013 - 08:07 AM.
Members - Reputation: 168
Posted 05 November 2013 - 03:14 PM
I'm not sure what they are doing in UE4, but it seems to me that you would want cavity to scale the grazing angle specular contribution and also scale the diffuse. If it simply scales the specular it would shadow even if the reflection is coming straight from the view direction. Simply scaling the fresnel term might give reasonable results. Something like:
F = f0 + (1.0 - f0) * (1.0 - H.V)5 * (1.0 - cavity)
Or you might need to scale the entire fresnel term by a view dependent cavity.
F *= 1.0 - (1.0 - H.V) * cavity
I haven't tried any of this yet, so take this with a grain of salt.