From 155a8ceecfe64773eb21ba55a2ac286d52589141 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 24 Feb 2026 01:37:59 -0800 Subject: Rewrite SH9 core, more concise --- pbr.cginc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pbr.cginc') diff --git a/pbr.cginc b/pbr.cginc index a01c185..4389476 100755 --- a/pbr.cginc +++ b/pbr.cginc @@ -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); -- cgit v1.2.3