i’m trying to understand something about the smoothness map about how to handle roughness->smoothness conversion, i use the same 1-roughness from 10 years, 'cause In quite all the tutorials/comments/sites i did find/find "use: 1 - roughness to produce smoothness" or “invert colors in photo editing software”
But it seems there should be two different way to convert to smoothness depending on which pipeline is used or some other factor (eg blinn phong vs ggx).
- URP: This shading model is based on the Blinn-Phong model.
- Built-in and HDRP use GGX (HDRP: Unity Blog, Built-in reporting this here Unity Blog):
Unity 5.3 uses smoothness instead of roughness maps, where smoothness is converted into academic roughness in the shader, using the formula (1-smoothness)^2. Distribution wise this is equivalent to Burley’s roughness, but reversed such that the most blurry response maps to 0.0 and perfect mirror reflection maps to 1.0, which we find more intuitive.
This affirmations let to guess the formula to be used is: 1-sqrt(roughness) to produce smoothness
Dunno if important but other informations abouth roughness from some software i use:
- (https://creativecloud.adobe.com/cc/learn/substance-3d-designer/web/the-pbr-guide-part-2): the Substance PBR shaders for metal/roughness and specular/ glossiness use GGX BRDF and do not use any value remapping for roughness/glossiness. Templates use glossiness node for channel packing.
2) Renderman, Unreal Engine 4, and Substance Designer and Painter all square the roughness for GGX (ref: https://blender.stackexchange.com/questions/40586/what-do-glossy-distribution-models-do/41195#41195)
About blender this behaviour is confirmed: source code(https://github.com/blender/blender/…cycles/kernel/integrator/surface_shader.h#L29)
Checking Unity:
-
URP/autodesk interactive shader graph uses the nodes which produces the formula : 1- (sqrt(roughness)) which is quite different as result comparing to 1- roughness in terms of pure function evaluation.
-
HDRP/autodesk interactive shader graph uses the same formula of URP
-
Standard/autodesk shader → uses 1-glossiness : row 1) _Glossiness (“Roughness”, Range(0.000000,1.000000)) = 0.500000 row 2) uses u_xlat0.x = (-FGlobals._Glossiness) + 1.0;
I was thinking Autodesk interactive (URP and HDRP) maybe uses it due to some image elaboration they did when baking in their apps (like maya or max) but when i found the article on 5.3 and ggx which declares they use of the same formula i started to get having doubts.
So i didn’t manage to get a proof if:
- 1-roughness is the proper one for all the pipelines (and from all the DCC from where it was made)
- 1-sqrt(roughness) is the proper one for all the pipelines (and from all the DCC from where it was made)
- both: depending on the pipeline.
These functions are quite different when on a chart so the results are different.