From 9c41a5c27996e221cf496eeb8ddee9d43a11db24 Mon Sep 17 00:00:00 2001 From: Exist Date: Wed, 5 Feb 2025 23:25:06 +0100 Subject: [PATCH 1/2] albedo to gamma, remove other conversions --- package/Shaders/AmbientCompositeCS.hlsl | 11 +++---- package/Shaders/Common/Color.hlsli | 20 +++++++++-- package/Shaders/Common/PBR.hlsli | 6 ++-- package/Shaders/DeferredCompositeCS.hlsl | 4 +-- package/Shaders/Lighting.hlsl | 42 ++++++++++-------------- package/Shaders/RunGrass.hlsl | 10 +++--- 6 files changed, 49 insertions(+), 44 deletions(-) diff --git a/package/Shaders/AmbientCompositeCS.hlsl b/package/Shaders/AmbientCompositeCS.hlsl index cfdefb6d01..077b3d33c2 100644 --- a/package/Shaders/AmbientCompositeCS.hlsl +++ b/package/Shaders/AmbientCompositeCS.hlsl @@ -55,17 +55,16 @@ void SampleSSGI(uint2 pixCoord, float3 normalWS, out float ao, out float3 il) float3 albedo = AlbedoTexture[dispatchID.xy]; float3 masks2 = Masks2Texture[dispatchID.xy]; - float pbrWeight = masks2.z; float3 normalWS = normalize(mul(FrameBuffer::CameraViewInverse[eyeIndex], float4(normalVS, 0)).xyz); float3 directionalAmbientColor = mul(SharedData::DirectionalAmbient, float4(normalWS, 1.0)); - float3 linAlbedo = Color::GammaToLinear(albedo) / Color::AlbedoPreMult; - float3 linDirectionalAmbientColor = Color::GammaToLinear(directionalAmbientColor) / Color::LightPreMult; + float3 linAlbedo = Color::GammaToLinear(albedo); + float3 linDirectionalAmbientColor = Color::GammaToLinear(directionalAmbientColor); float3 linDiffuseColor = Color::GammaToLinear(diffuseColor); - float3 linAmbient = lerp(Color::GammaToLinear(albedo * directionalAmbientColor), linAlbedo * linDirectionalAmbientColor, pbrWeight); + float3 linAmbient = Color::GammaToLinear(albedo * directionalAmbientColor); float visibility = 1.0; #if defined(SKYLIGHTING) @@ -120,9 +119,9 @@ void SampleSSGI(uint2 pixCoord, float3 normalWS, out float ao, out float3 il) linAmbient *= visibility; diffuseColor = Color::LinearToGamma(linDiffuseColor); - directionalAmbientColor = Color::LinearToGamma(linDirectionalAmbientColor * visibility * Color::LightPreMult); + directionalAmbientColor = Color::LinearToGamma(linDirectionalAmbientColor * visibility); - diffuseColor = lerp(diffuseColor + directionalAmbientColor * albedo, Color::LinearToGamma(linDiffuseColor + linAmbient), pbrWeight); + diffuseColor = diffuseColor + directionalAmbientColor * albedo; MainRW[dispatchID.xy] = float4(diffuseColor, 1); }; \ No newline at end of file diff --git a/package/Shaders/Common/Color.hlsli b/package/Shaders/Common/Color.hlsli index 3a4d7b31dc..de8347636c 100644 --- a/package/Shaders/Common/Color.hlsli +++ b/package/Shaders/Common/Color.hlsli @@ -41,8 +41,8 @@ namespace Color tmp - color.y); } - const static float AlbedoPreMult = 1 / 1.7; // greater value -> brighter pbr - const static float LightPreMult = 1 / (Math::PI * AlbedoPreMult); // ensure 1/PI as product + // attempt to match vanilla diffuse that's a bit darker than normal srgb textures + const static float AlbedoDiffusePower = 1 / 1.7; float3 GammaToLinear(float3 color) { @@ -53,6 +53,22 @@ namespace Color { return pow(abs(color), 1.0 / 2.2); } + + float3 Diffuse(float3 color){ +#if defined(TRUE_PBR) + return pow(abs(color), AlbedoDiffusePower); +#else + return color; +#endif + } + + float3 Light(float3 color){ +#if defined(TRUE_PBR) + return color * Math::PI; +#else + return color; +#endif + } } #endif //__COLOR_DEPENDENCY_HLSL__ \ No newline at end of file diff --git a/package/Shaders/Common/PBR.hlsli b/package/Shaders/Common/PBR.hlsli index 6b257413ad..651d1abbca 100644 --- a/package/Shaders/Common/PBR.hlsli +++ b/package/Shaders/Common/PBR.hlsli @@ -123,10 +123,10 @@ namespace PBR LightProperties InitLightProperties(float3 lightColor, float3 nonParallaxShadow, float3 parallaxShadow) { LightProperties result; - result.LinearLightColor = Color::GammaToLinear(lightColor) * nonParallaxShadow * parallaxShadow / Color::LightPreMult; + result.LinearLightColor = lightColor * nonParallaxShadow * parallaxShadow; [branch] if ((PBRFlags & Flags::InterlayerParallax) != 0) { - result.LinearCoatLightColor = Color::GammaToLinear(lightColor) * nonParallaxShadow / Color::LightPreMult; + result.LinearCoatLightColor = lightColor * nonParallaxShadow; } else { @@ -587,7 +587,7 @@ namespace PBR diffuseAO = MultiBounceAO(diffuseColor, diffuseAO.x).y; specularAO = MultiBounceAO(surfaceProperties.F0, specularAO.x).y; - diffuseLobeWeight *= diffuseAO / Math::PI; + diffuseLobeWeight *= diffuseAO; specularLobeWeight *= specularAO; } diff --git a/package/Shaders/DeferredCompositeCS.hlsl b/package/Shaders/DeferredCompositeCS.hlsl index dbb4ccbf87..8bda394791 100644 --- a/package/Shaders/DeferredCompositeCS.hlsl +++ b/package/Shaders/DeferredCompositeCS.hlsl @@ -88,11 +88,9 @@ void SampleSSGISpecular(uint2 pixCoord, sh2 lobe, out float ao, out float3 il) MotionVectorsRW[dispatchID.xy] = MotionBlur::GetSSMotionVector(positionWS, positionWS, eyeIndex); // Apply sky motion vectors } - float pbrWeight = masks2.z; - float glossiness = normalGlossiness.z; - float3 color = lerp(diffuseColor + specularColor, Color::LinearToGamma(Color::GammaToLinear(diffuseColor) + Color::GammaToLinear(specularColor)), pbrWeight); + float3 color = diffuseColor + specularColor; #if defined(DYNAMIC_CUBEMAPS) diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index 181132d439..f39a299623 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -1299,10 +1299,10 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(TRUE_PBR) && defined(LANDSCAPE) [branch] if ((PBRFlags & PBR::TerrainFlags::LandTile0PBR) == 0) { - rawBaseColor.rgb = Color::GammaToLinear(rawBaseColor.rgb) / Color::AlbedoPreMult; + // relevant for linear only } # endif - baseColor = rawBaseColor; + baseColor = float4(Color::Diffuse(rawBaseColor.rgb), rawBaseColor.a); float landSnowMask1 = GetLandSnowMaskValue(baseColor.w); float4 normalColor = TexNormalSampler.Sample(SampNormalSampler, uv); @@ -1390,6 +1390,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace if (input.LandBlendWeights1.y > 0.0) { float4 landColor2 = TexLandColor2Sampler.Sample(SampLandColor2Sampler, uv); + landColor2.rgb = Color::Diffuse(landColor2.rgb); float landSnowMask2 = GetLandSnowMaskValue(landColor2.w); float4 landNormal2 = TexLandNormal2Sampler.Sample(SampLandNormal2Sampler, uv); landNormal2.xyz = GetLandNormal(landSnowMask2, landNormal2.xyz, uv, SampLandNormal2Sampler, TexLandNormal2Sampler); @@ -1409,7 +1410,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace } else { - landColor2.rgb = Color::GammaToLinear(landColor2.rgb) / Color::AlbedoPreMult; rawRMAOS += input.LandBlendWeights1.y * float4(1 - landNormal2.w, 0, 1, 0.04); } # endif @@ -1418,6 +1418,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace if (input.LandBlendWeights1.z > 0.0) { float4 landColor3 = TexLandColor3Sampler.Sample(SampLandColor3Sampler, uv); + landColor3.rgb = Color::Diffuse(landColor3.rgb); float landSnowMask3 = GetLandSnowMaskValue(landColor3.w); float4 landNormal3 = TexLandNormal3Sampler.Sample(SampLandNormal3Sampler, uv); landNormal3.xyz = GetLandNormal(landSnowMask3, landNormal3.xyz, uv, SampLandNormal3Sampler, TexLandNormal3Sampler); @@ -1437,7 +1438,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace } else { - landColor3.rgb = Color::GammaToLinear(landColor3.rgb) / Color::AlbedoPreMult; rawRMAOS += input.LandBlendWeights1.z * float4(1 - landNormal3.w, 0, 1, 0.04); } # endif @@ -1446,6 +1446,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace if (input.LandBlendWeights1.w > 0.0) { float4 landColor4 = TexLandColor4Sampler.Sample(SampLandColor4Sampler, uv); + landColor4.rgb = Color::Diffuse(landColor4.rgb); float landSnowMask4 = GetLandSnowMaskValue(landColor4.w); float4 landNormal4 = TexLandNormal4Sampler.Sample(SampLandNormal4Sampler, uv); landNormal4.xyz = GetLandNormal(landSnowMask4, landNormal4.xyz, uv, SampLandNormal4Sampler, TexLandNormal4Sampler); @@ -1465,7 +1466,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace } else { - landColor4.rgb = Color::GammaToLinear(landColor4.rgb) / Color::AlbedoPreMult; rawRMAOS += input.LandBlendWeights1.w * float4(1 - landNormal4.w, 0, 1, 0.04); } # endif @@ -1474,6 +1474,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace if (input.LandBlendWeights2.x > 0.0) { float4 landColor5 = TexLandColor5Sampler.Sample(SampLandColor5Sampler, uv); + landColor5.rgb = Color::Diffuse(landColor5.rgb); float landSnowMask5 = GetLandSnowMaskValue(landColor5.w); float4 landNormal5 = TexLandNormal5Sampler.Sample(SampLandNormal5Sampler, uv); landNormal5.xyz = GetLandNormal(landSnowMask5, landNormal5.xyz, uv, SampLandNormal5Sampler, TexLandNormal5Sampler); @@ -1493,7 +1494,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace } else { - landColor5.rgb = Color::GammaToLinear(landColor5.rgb) / Color::AlbedoPreMult; rawRMAOS += input.LandBlendWeights2.x * float4(1 - landNormal5.w, 0, 1, 0.04); } # endif @@ -1502,6 +1502,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace if (input.LandBlendWeights2.y > 0.0) { float4 landColor6 = TexLandColor6Sampler.Sample(SampLandColor6Sampler, uv); + landColor6.rgb = Color::Diffuse(landColor6.rgb); float landSnowMask6 = GetLandSnowMaskValue(landColor6.w); float4 landNormal6 = TexLandNormal6Sampler.Sample(SampLandNormal6Sampler, uv); landNormal6.xyz = GetLandNormal(landSnowMask6, landNormal6.xyz, uv, SampLandNormal6Sampler, TexLandNormal6Sampler); @@ -1521,7 +1522,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace } else { - landColor6.rgb = Color::GammaToLinear(landColor6.rgb) / Color::AlbedoPreMult; rawRMAOS += input.LandBlendWeights2.y * float4(1 - landNormal6.w, 0, 1, 0.04); } # endif @@ -1889,7 +1889,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace waterRoughnessSpecular = 1.0 - wetnessGlossinessSpecular; # endif - float3 dirLightColor = DirLightColor.xyz; + float3 dirLightColor = Color::Light(DirLightColor.xyz); float3 dirLightColorMultiplier = 1; # if defined(WATER_EFFECTS) @@ -2039,7 +2039,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(WETNESS_EFFECTS) if (waterRoughnessSpecular < 1.0) - wetnessSpecular += WetnessEffects::GetWetnessSpecular(wetnessNormal, normalizedDirLightDirectionWS, worldSpaceViewDirection, Color::GammaToLinear(dirLightColor * dirDetailShadow) / Color::LightPreMult, waterRoughnessSpecular); + wetnessSpecular += WetnessEffects::GetWetnessSpecular(wetnessNormal, normalizedDirLightDirectionWS, worldSpaceViewDirection, Color::GammaToLinear(dirLightColor * dirDetailShadow), waterRoughnessSpecular); # endif # endif @@ -2054,7 +2054,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace continue; float intensityMultiplier = 1 - intensityFactor * intensityFactor; - float3 lightColor = PointLightColor[lightIndex].xyz * intensityMultiplier; + float3 lightColor = Color::Light(PointLightColor[lightIndex].xyz) * intensityMultiplier; float lightShadow = 1.f; if (Permutation::PixelShaderDescriptor & Permutation::LightingFlags::DefShadow) { if (lightIndex < numShadowLights) { @@ -2151,7 +2151,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace continue; float intensityMultiplier = 1 - intensityFactor * intensityFactor; - float3 lightColor = light.color.xyz * intensityMultiplier; + float3 lightColor = Color::Light(light.color.xyz) * intensityMultiplier; float lightShadow = 1.0; float shadowComponent = 1.0; @@ -2254,7 +2254,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(WETNESS_EFFECTS) if (waterRoughnessSpecular < 1.0) - wetnessSpecular += WetnessEffects::GetWetnessSpecular(wetnessNormal, normalizedLightDirection, worldSpaceViewDirection, Color::GammaToLinear(lightColor) / Color::LightPreMult, waterRoughnessSpecular); + wetnessSpecular += WetnessEffects::GetWetnessSpecular(wetnessNormal, normalizedLightDirection, worldSpaceViewDirection, Color::GammaToLinear(lightColor), waterRoughnessSpecular); # endif } # endif @@ -2267,9 +2267,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace if (Permutation::PixelShaderDescriptor & Permutation::LightingFlags::CharacterLight) { float charLightMul = saturate(dot(worldSpaceViewDirection, worldSpaceNormal.xyz)) * CharacterLightParams.x + CharacterLightParams.y * saturate(dot(float2(0.164398998, -0.986393988), worldSpaceNormal.yz)); float charLightColor = min(CharacterLightParams.w, max(0, CharacterLightParams.z * TexCharacterLightProjNoiseSampler.Sample(SampCharacterLightProjNoiseSampler, baseShadowUV).x)); -# if defined(TRUE_PBR) - charLightColor = Color::GammaToLinear(charLightColor).x / Color::LightPreMult; -# endif diffuseColor += (charLightMul * charLightColor).xxx; } # endif @@ -2296,9 +2293,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # endif float3 directionalAmbientColor = mul(DirectionalAmbient, modelNormal); -# if defined(TRUE_PBR) - directionalAmbientColor = Color::GammaToLinear(directionalAmbientColor) / Color::LightPreMult; -# endif float3 reflectionDiffuseColor = diffuseColor + directionalAmbientColor; @@ -2307,11 +2301,11 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace skylightingDiffuse = lerp(1.0, skylightingDiffuse, Skylighting::getFadeOutFactor(input.WorldPosition.xyz)); skylightingDiffuse = Skylighting::mixDiffuse(SharedData::skylightingSettings, skylightingDiffuse); # if !defined(TRUE_PBR) - directionalAmbientColor = Color::GammaToLinear(directionalAmbientColor) / Color::LightPreMult; + directionalAmbientColor = Color::GammaToLinear(directionalAmbientColor); # endif directionalAmbientColor *= skylightingDiffuse; # if !defined(TRUE_PBR) - directionalAmbientColor = Color::LinearToGamma(directionalAmbientColor * Color::LightPreMult); + directionalAmbientColor = Color::LinearToGamma(directionalAmbientColor); # endif # endif @@ -2563,12 +2557,10 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace specularColor *= complexSpecular; # endif // defined (EMAT) && defined(ENVMAP) -# if !defined(TRUE_PBR) # if !defined(DEFERRED) color.xyz += specularColor; # endif color.xyz = Color::GammaToLinear(color.xyz); -# endif # if defined(WETNESS_EFFECTS) && !defined(TRUE_PBR) color.xyz += wetnessSpecular * wetnessGlossinessSpecular; @@ -2589,7 +2581,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(DEFERRED) specularColorPBR = lerp(specularColorPBR, 0, lodLandBlendFactor); - indirectDiffuseLobeWeight = lerp(indirectDiffuseLobeWeight, Color::GammaToLinear(input.Color.xyz * lodLandColor * lodLandFadeFactor) / Color::AlbedoPreMult, lodLandBlendFactor); + indirectDiffuseLobeWeight = lerp(indirectDiffuseLobeWeight, input.Color.xyz * lodLandColor * lodLandFadeFactor, lodLandBlendFactor); indirectSpecularLobeWeight = lerp(indirectSpecularLobeWeight, 0, lodLandBlendFactor); pbrGlossiness = lerp(pbrGlossiness, 0, lodLandBlendFactor); # endif @@ -2734,13 +2726,13 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float3 outputSpecular = specularColor.xyz; # if defined(TRUE_PBR) - outputSpecular = Color::LinearToGamma(specularColorPBR.xyz); + outputSpecular = specularColorPBR.xyz; # endif psout.Specular = float4(outputSpecular, psout.Diffuse.w); float3 outputAlbedo = baseColor.xyz * vertexColor; # if defined(TRUE_PBR) - outputAlbedo = Color::LinearToGamma(indirectDiffuseLobeWeight * Color::AlbedoPreMult); + outputAlbedo = indirectDiffuseLobeWeight; # endif psout.Albedo = float4(outputAlbedo, psout.Diffuse.w); diff --git a/package/Shaders/RunGrass.hlsl b/package/Shaders/RunGrass.hlsl index cd2367944a..3478a29f65 100644 --- a/package/Shaders/RunGrass.hlsl +++ b/package/Shaders/RunGrass.hlsl @@ -680,9 +680,9 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace skylighting = lerp(1.0, skylighting, Skylighting::getFadeOutFactor(input.WorldPosition)); skylighting = Skylighting::mixDiffuse(SharedData::skylightingSettings, skylighting); - directionalAmbientColor = Color::GammaToLinear(directionalAmbientColor) / Color::LightPreMult; + directionalAmbientColor = Color::GammaToLinear(directionalAmbientColor); directionalAmbientColor *= skylighting; - directionalAmbientColor = Color::LinearToGamma(directionalAmbientColor * Color::LightPreMult); + directionalAmbientColor = Color::LinearToGamma(directionalAmbientColor); # endif // SKYLIGHTING diffuseColor += directionalAmbientColor; @@ -713,7 +713,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float3 normalVS = normalize(FrameBuffer::WorldToView(normal, false, eyeIndex)); # if defined(TRUE_PBR) - psout.Albedo = float4(Color::LinearToGamma(indirectDiffuseLobeWeight * Color::AlbedoPreMult), 1); + psout.Albedo = float4(Color::LinearToGamma(indirectDiffuseLobeWeight), 1); psout.NormalGlossiness = float4(GBuffer::EncodeNormal(normalVS), 1 - pbrSurfaceProperties.Roughness, 1); psout.Reflectance = float4(indirectSpecularLobeWeight, 1); psout.Parameters = float4(0, 0, 1, 1); @@ -837,9 +837,9 @@ PS_OUTPUT main(PS_INPUT input) skylighting = lerp(1.0, skylighting, Skylighting::getFadeOutFactor(input.WorldPosition)); skylighting = Skylighting::mixDiffuse(SharedData::skylightingSettings, skylighting); - directionalAmbientColor = Color::GammaToLinear(directionalAmbientColor) / Color::LightPreMult; + directionalAmbientColor = Color::GammaToLinear(directionalAmbientColor); directionalAmbientColor *= skylighting; - directionalAmbientColor = Color::LinearToGamma(directionalAmbientColor * Color::LightPreMult); + directionalAmbientColor = Color::LinearToGamma(directionalAmbientColor); # endif // SKYLIGHTING diffuseColor += directionalAmbientColor; From 0a12e8e88c0876c5d0257190228abba53d834ab4 Mon Sep 17 00:00:00 2001 From: ThePagi Date: Wed, 5 Feb 2025 22:26:14 +0000 Subject: [PATCH 2/2] =?UTF-8?q?style:=20=F0=9F=8E=A8=20apply=20clang-forma?= =?UTF-8?q?t=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/Shaders/AmbientCompositeCS.hlsl | 1 - package/Shaders/Common/Color.hlsli | 6 ++++-- package/Shaders/Lighting.hlsl | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package/Shaders/AmbientCompositeCS.hlsl b/package/Shaders/AmbientCompositeCS.hlsl index 077b3d33c2..3f892b06cd 100644 --- a/package/Shaders/AmbientCompositeCS.hlsl +++ b/package/Shaders/AmbientCompositeCS.hlsl @@ -55,7 +55,6 @@ void SampleSSGI(uint2 pixCoord, float3 normalWS, out float ao, out float3 il) float3 albedo = AlbedoTexture[dispatchID.xy]; float3 masks2 = Masks2Texture[dispatchID.xy]; - float3 normalWS = normalize(mul(FrameBuffer::CameraViewInverse[eyeIndex], float4(normalVS, 0)).xyz); float3 directionalAmbientColor = mul(SharedData::DirectionalAmbient, float4(normalWS, 1.0)); diff --git a/package/Shaders/Common/Color.hlsli b/package/Shaders/Common/Color.hlsli index de8347636c..b83b6a56dd 100644 --- a/package/Shaders/Common/Color.hlsli +++ b/package/Shaders/Common/Color.hlsli @@ -54,7 +54,8 @@ namespace Color return pow(abs(color), 1.0 / 2.2); } - float3 Diffuse(float3 color){ + float3 Diffuse(float3 color) + { #if defined(TRUE_PBR) return pow(abs(color), AlbedoDiffusePower); #else @@ -62,7 +63,8 @@ namespace Color #endif } - float3 Light(float3 color){ + float3 Light(float3 color) + { #if defined(TRUE_PBR) return color * Math::PI; #else diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index f39a299623..2bf2acc0a0 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -2557,9 +2557,9 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace specularColor *= complexSpecular; # endif // defined (EMAT) && defined(ENVMAP) -# if !defined(DEFERRED) +# if !defined(DEFERRED) color.xyz += specularColor; -# endif +# endif color.xyz = Color::GammaToLinear(color.xyz); # if defined(WETNESS_EFFECTS) && !defined(TRUE_PBR)