Variable getIBLSheenConst
getIBLSheen: "\nfn getSheenAlbedoScaleApprox(normal: vec3f, viewDirection: vec3f, sheenRoughness: f32) -> f32 {\n let NdotV: f32 = saturate( dot( normal, viewDirection ) );\n let s = saturate(sheenRoughness);\n\n // amplitude (stronger compensation for sharper sheen)\n let A = 0.28 + 0.6 * (1.0 - s); // in [0.28 .. 0.88]\n\n // exponent (controls how fast it falls off away from grazing)\n let B = 1.8 + 3.2 * s; // in [1.8 .. 5.0]\n\n // (1 - x) is high at grazing; raising to B shapes the falloff\n return A * pow(1.0 - NdotV, B);\n}\n\nfn getBRDFCharlie(\n normal: vec3f,\n viewDirection: vec3f,\n sheenRoughness: f32,\n clampSampler: sampler,\n lutTexture: texture_2d<f32>\n) -> f32 {\n let NdotV: f32 = saturate(dot(normal, viewDirection));\n \n let brdfSamplePoint: vec2f = saturate(vec2(NdotV, sheenRoughness));\n \n return textureSampleLevel(\n lutTexture,\n clampSampler,\n brdfSamplePoint,\n 0.0\n ).b;\n}\n\n// This is a curve-fit approxmation to the \"Charlie sheen\" BRDF integrated over the hemisphere from \n// Estevez and Kulla 2017, \"Production Friendly Microfacet Sheen BRDF\". The analysis can be found\n// in the Sheen section of https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\nfn getBRDFCharlieApprox( normal: vec3f, viewDirection: vec3f, roughness: f32 ) -> f32 {\n let NdotV: f32 = saturate( dot( normal, viewDirection ) );\n\n let r2: f32 = roughness * roughness;\n let rInv: f32 = 1.0 / ( roughness + 0.1 );\n\n let a: f32 = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\n let b: f32 = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\n\n let DG: f32 = exp( a * NdotV + b );\n\n return saturate( DG );\n}\n\n// Indirect Diffuse RenderEquations with sheen albedo scaling\nfn RE_IndirectDiffuseSheen(\n irradiance: vec3f,\n diffuseContribution: vec3f,\n sheenEnergyComp: f32,\n ptr_reflectedLight: ptr<function, ReflectedLight>\n) {\n var diffuse: vec3f = irradiance * BRDF_Lambert( diffuseContribution );\n\tdiffuse *= sheenEnergyComp;\n (*ptr_reflectedLight).indirectDiffuse += diffuse;\n}\n" = ...
WGSL functions to calculate sheen specular indirect IBL contribution.