diff options
Diffstat (limited to 'pbr.cginc')
| -rwxr-xr-x | pbr.cginc | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -8,6 +8,12 @@ #include "texture_utils.cginc" #include "impostor.cginc" +// From filament: min roughness s.t. MIN_PERCEPTUAL_ROUGHNESS^4 > 0 in target +// precision. Although we use fp32, the higher min roughness gives us a broader +// specular highlight, which is preferable. +#define MIN_PERCEPTUAL_ROUGHNESS 0.045 +#define MIN_ROUGHNESS 0.002025 + struct Pbr { float4 albedo; float3 normal; @@ -33,12 +39,6 @@ struct Pbr { #endif }; -// From filament: min roughness s.t. MIN_PERCEPTUAL_ROUGHNESS^4 > 0 in target -// precision. We use fp32. The smallest non-subnormal is 2^(-126). The 4th -// root of that is ~3.29 * 10^-10. -#define MIN_PERCEPTUAL_ROUGHNESS (3.3E-10) -#define MIN_ROUGHNESS (1.09E-19) - #if defined(_PARALLAX_HEIGHTMAP) float2 parallax_offset(float2 uv, float3 view_dir_world, float3x3 tbn) { float3 view_dir_tangent = mul(tbn, view_dir_world); |
