diff --git a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli index 7db9c0671..2db4d9e8e 100644 --- a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli +++ b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli @@ -25,7 +25,6 @@ float3 GetDynamicCubemapSpecularIrradiance(float2 uv, float3 N, float3 VN, float float3 specularIrradiance = specularTexture.SampleLevel(SampColorSampler, R, level).xyz; specularIrradiance *= horizon; - specularIrradiance = sRGB2Lin(specularIrradiance); return specularIrradiance; } @@ -53,7 +52,6 @@ float3 GetDynamicCubemap(float2 uv, float3 N, float3 VN, float3 V, float roughne return horizon * ((F0 + S) * specularBRDF.x + specularBRDF.y); # else float3 specularIrradiance = specularTexture.SampleLevel(SampColorSampler, R, level).xyz; - specularIrradiance = sRGB2Lin(specularIrradiance); return specularIrradiance * ((F0 + S) * specularBRDF.x + specularBRDF.y); # endif diff --git a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/InferCubemapCS.hlsl b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/InferCubemapCS.hlsl index 0fdb04157..306ff130a 100644 --- a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/InferCubemapCS.hlsl +++ b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/InferCubemapCS.hlsl @@ -90,11 +90,10 @@ float3 GetSamplingVector(uint3 ThreadID, in RWTexture2DArray OutputTextu } #if defined(REFLECTIONS) - color.rgb = lerp(color.rgb, sRGB2Lin(ReflectionsTexture.SampleLevel(LinearSampler, uv, 0)), saturate(mipLevel / 8.0)); + color.rgb = lerp(color.rgb, ReflectionsTexture.SampleLevel(LinearSampler, uv, 0), saturate(mipLevel / 8.0)); #else - color.rgb = lerp(color.rgb, color.rgb * sRGB2Lin(DefaultCubemap.SampleLevel(LinearSampler, uv, 0).x) * 2, saturate(mipLevel / 8.0)); + color.rgb = lerp(color.rgb, color.rgb * DefaultCubemap.SampleLevel(LinearSampler, uv, 0).x * 2, saturate(mipLevel / 8.0)); #endif - color.rgb = Lin2sRGB(color.rgb); EnvInferredTexture[ThreadID] = max(0, color); } diff --git a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/SpecularIrradianceCS.hlsl b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/SpecularIrradianceCS.hlsl index 07a68b2b2..d5169e9cf 100644 --- a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/SpecularIrradianceCS.hlsl +++ b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/SpecularIrradianceCS.hlsl @@ -118,16 +118,6 @@ float3 tangentToWorld(const float3 v, const float3 N, const float3 S, const floa return S * v.x + T * v.y + N * v.z; } -float3 sRGB2Lin(float3 color) -{ - return color > 0.04045 ? pow(color / 1.055 + 0.055 / 1.055, 2.4) : color / 12.92; -} - -float3 Lin2sRGB(float3 color) -{ - return color > 0.0031308 ? 1.055 * pow(color, 1.0 / 2.4) - 0.055 : 12.92 * color; -} - [numthreads(8, 8, 1)] void main(uint3 ThreadID : SV_DispatchThreadID) { // Make sure we won't write past output when computing higher mipmap levels. @@ -181,11 +171,11 @@ float3 Lin2sRGB(float3 color) // Mip level to sample from. float mipLevel = max(0.5 * log2(ws / wt) + 1.0, 0.0); - color += sRGB2Lin(inputTexture.SampleLevel(linear_wrap_sampler, Li, mipLevel).rgb) * cosLi; + color += inputTexture.SampleLevel(linear_wrap_sampler, Li, mipLevel).rgb * cosLi; weight += cosLi; } } color /= weight; - outputTexture[ThreadID] = float4(Lin2sRGB(color), 1.0); + outputTexture[ThreadID] = float4(color, 1.0); } diff --git a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/UpdateCubemapCS.hlsl b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/UpdateCubemapCS.hlsl index e47cf9e78..ee5dac74d 100644 --- a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/UpdateCubemapCS.hlsl +++ b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/UpdateCubemapCS.hlsl @@ -59,11 +59,6 @@ cbuffer UpdateData : register(b1) bool IsSaturated(float value) { return value == saturate(value); } bool IsSaturated(float2 value) { return IsSaturated(value.x) && IsSaturated(value.y); } -float3 sRGB2Lin(float3 color) -{ - return color > 0.04045 ? pow(color / 1.055 + 0.055 / 1.055, 2.4) : color / 12.92; -} - // Inverse project UV + raw depth into world space. float3 InverseProjectUVZ(float2 uv, float z) { @@ -172,7 +167,7 @@ float smoothbumpstep(float edge0, float edge1, float x) if (linearDepth > 16.5) { // Ignore objects which are too close float3 color = ColorTexture.SampleLevel(LinearSampler, uv, 0); - float4 output = float4(sRGB2Lin(color), 1.0); + float4 output = float4(color, 1.0); float lerpFactor = 1.0 / 64.0; half4 positionCS = half4(2 * half2(uv.x, -uv.y + 1) - 1, depth, 1); diff --git a/features/Screen Space GI/Shaders/ScreenSpaceGI/radianceDisocc.cs.hlsl b/features/Screen Space GI/Shaders/ScreenSpaceGI/radianceDisocc.cs.hlsl index e415741c9..83aaf8da6 100644 --- a/features/Screen Space GI/Shaders/ScreenSpaceGI/radianceDisocc.cs.hlsl +++ b/features/Screen Space GI/Shaders/ScreenSpaceGI/radianceDisocc.cs.hlsl @@ -131,7 +131,7 @@ void readHistory( half3 radiance = 0; #ifdef GI - radiance = sRGB2Lin(FULLRES_LOAD(srcDiffuse, pixCoord, uv * frameScale, samplerLinearClamp).rgb * GIStrength); + radiance = FULLRES_LOAD(srcDiffuse, pixCoord, uv * frameScale, samplerLinearClamp).rgb * GIStrength; # ifdef GI_BOUNCE radiance += prev_ambient.rgb * GIBounceFade; # endif diff --git a/features/Subsurface Scattering/Shaders/SubsurfaceScattering/SeparableSSS.hlsli b/features/Subsurface Scattering/Shaders/SubsurfaceScattering/SeparableSSS.hlsli index 4df504257..cc0eeb324 100644 --- a/features/Subsurface Scattering/Shaders/SubsurfaceScattering/SeparableSSS.hlsli +++ b/features/Subsurface Scattering/Shaders/SubsurfaceScattering/SeparableSSS.hlsli @@ -99,10 +99,6 @@ float4 SSSSBlurCS( // Fetch color of current pixel: float4 colorM = ColorTexture[DTid.xy]; -#if defined(HORIZONTAL) - colorM.rgb = sRGB2Lin(colorM.rgb); -#endif - if (sssAmount == 0) return colorM; @@ -156,10 +152,6 @@ float4 SSSSBlurCS( float3 color = ColorTexture[coords].rgb; -#if defined(HORIZONTAL) - color.rgb = sRGB2Lin(color.rgb); -#endif - float depth = DepthTexture[coords].r; depth = GetScreenDepth(depth); diff --git a/features/Subsurface Scattering/Shaders/SubsurfaceScattering/SeparableSSSCS.hlsl b/features/Subsurface Scattering/Shaders/SubsurfaceScattering/SeparableSSSCS.hlsl index 71668c8ac..bc8f1bdb0 100644 --- a/features/Subsurface Scattering/Shaders/SubsurfaceScattering/SeparableSSSCS.hlsl +++ b/features/Subsurface Scattering/Shaders/SubsurfaceScattering/SeparableSSSCS.hlsl @@ -39,7 +39,6 @@ cbuffer PerFrameSSS : register(b1) bool humanProfile = MaskTexture[DTid.xy].y == sssAmount; float4 color = SSSSBlurCS(DTid.xy, texCoord, float2(0.0, 1.0), sssAmount, humanProfile); - color.rgb = Lin2sRGB(color.rgb); SSSRW[DTid.xy] = float4(color.rgb, 1.0); #endif diff --git a/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli b/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli index 5bfe30074..e10cd9a1c 100644 --- a/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli +++ b/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli @@ -144,7 +144,7 @@ float3 GetWetnessAmbientSpecular(float2 uv, float3 N, float3 VN, float3 V, float float3 specularIrradiance = 1.0; # else float level = roughness * 7.0; - float3 specularIrradiance = sRGB2Lin(specularTexture.SampleLevel(SampColorSampler, R, level)); + float3 specularIrradiance = specularTexture.SampleLevel(SampColorSampler, R, level); # endif #else float3 specularIrradiance = 1.0; diff --git a/package/Shaders/AmbientCompositeCS.hlsl b/package/Shaders/AmbientCompositeCS.hlsl index 946785500..ef641fd06 100644 --- a/package/Shaders/AmbientCompositeCS.hlsl +++ b/package/Shaders/AmbientCompositeCS.hlsl @@ -51,11 +51,7 @@ RWTexture2D DiffuseAmbientRW : register(u1); half3 directionalAmbientColor = mul(DirectionalAmbient, half4(normalWS, 1.0)); - half3 linAlbedo = sRGB2Lin(albedo); - half3 linDirectionalAmbientColor = sRGB2Lin(directionalAmbientColor); - half3 linDiffuseColor = sRGB2Lin(diffuseColor); - - half3 linAmbient = lerp(sRGB2Lin(albedo * directionalAmbientColor), linAlbedo * linDirectionalAmbientColor, pbrWeight); + half3 ambient = albedo * directionalAmbientColor; half visibility = 1.0; #if defined(SKYLIGHTING) @@ -76,24 +72,23 @@ RWTexture2D DiffuseAmbientRW : register(u1); #if defined(SSGI) half4 ssgiDiffuse = SSGITexture[dispatchID.xy]; - ssgiDiffuse.rgb *= linAlbedo; + ssgiDiffuse.rgb *= albedo; ssgiDiffuse.a = 1 - ssgiDiffuse.a; visibility *= ssgiDiffuse.a; - DiffuseAmbientRW[dispatchID.xy] = linAlbedo * linDirectionalAmbientColor + ssgiDiffuse.rgb; + DiffuseAmbientRW[dispatchID.xy] = albedo * directionalAmbientColor + ssgiDiffuse.rgb; # if defined(INTERIOR) - linDiffuseColor *= ssgiDiffuse.a; + diffuseColor *= ssgiDiffuse.a; # endif - linDiffuseColor += ssgiDiffuse.rgb; + diffuseColor += ssgiDiffuse.rgb; #endif - linAmbient *= visibility; - diffuseColor = Lin2sRGB(linDiffuseColor); - directionalAmbientColor = Lin2sRGB(linDirectionalAmbientColor * visibility); + ambient *= visibility; + directionalAmbientColor = directionalAmbientColor * visibility; - diffuseColor = lerp(diffuseColor + directionalAmbientColor * albedo, Lin2sRGB(linDiffuseColor + linAmbient), pbrWeight); + diffuseColor = diffuseColor + directionalAmbientColor * albedo; MainRW[dispatchID.xy] = diffuseColor; }; \ No newline at end of file diff --git a/package/Shaders/Common/PBR.hlsli b/package/Shaders/Common/PBR.hlsli index b8c1c4264..0f51f59c4 100644 --- a/package/Shaders/Common/PBR.hlsli +++ b/package/Shaders/Common/PBR.hlsli @@ -43,17 +43,17 @@ namespace PBR float3 AdjustDirectionalLightColor(float3 lightColor) { - return pbrSettings.DirectionalLightColorMultiplier * sRGB2Lin(lightColor); + return pbrSettings.DirectionalLightColorMultiplier * lightColor; } float3 AdjustPointLightColor(float3 lightColor) { - return pbrSettings.PointLightColorMultiplier * sRGB2Lin(lightColor); + return pbrSettings.PointLightColorMultiplier * lightColor; } float3 AdjustAmbientLightColor(float3 lightColor) { - return pbrSettings.AmbientLightColorMultiplier * sRGB2Lin(lightColor); + return pbrSettings.AmbientLightColorMultiplier * lightColor; } // [Jimenez et al. 2016, "Practical Realtime Strategies for Accurate Indirect Occlusion"] diff --git a/package/Shaders/DeferredCompositeCS.hlsl b/package/Shaders/DeferredCompositeCS.hlsl index 897f13635..dec13d56a 100644 --- a/package/Shaders/DeferredCompositeCS.hlsl +++ b/package/Shaders/DeferredCompositeCS.hlsl @@ -60,7 +60,7 @@ Texture2D SpecularSSGITexture : register(t10); half glossiness = normalGlossiness.z; - half3 color = lerp(diffuseColor + specularColor, Lin2sRGB(sRGB2Lin(diffuseColor) + sRGB2Lin(specularColor)), pbrWeight); + half3 color = diffuseColor + specularColor; #if defined(DYNAMIC_CUBEMAPS) @@ -73,8 +73,6 @@ Texture2D SpecularSSGITexture : register(t10); normalWS = lerp(normalWS, float3(0, 0, 1), wetnessMask); - color = sRGB2Lin(color); - half depth = DepthTexture[dispatchID.xy]; half4 positionCS = half4(2 * half2(uv.x, -uv.y + 1) - 1, depth, 1); @@ -89,12 +87,12 @@ Texture2D SpecularSSGITexture : register(t10); half roughness = 1.0 - glossiness; half level = roughness * 7.0; - half3 directionalAmbientColor = sRGB2Lin(mul(DirectionalAmbient, half4(R, 1.0))); + half3 directionalAmbientColor = mul(DirectionalAmbient, half4(R, 1.0)); half3 finalIrradiance = 0; # if defined(INTERIOR) half3 specularIrradiance = EnvTexture.SampleLevel(LinearSampler, R, level).xyz; - specularIrradiance = sRGB2Lin(specularIrradiance); + specularIrradiance = specularIrradiance; finalIrradiance += specularIrradiance; # elif defined(SKYLIGHTING) @@ -114,19 +112,19 @@ Texture2D SpecularSSGITexture : register(t10); if (skylightingSpecular < 1.0) { specularIrradiance = EnvTexture.SampleLevel(LinearSampler, R, level).xyz; - specularIrradiance = sRGB2Lin(specularIrradiance); + specularIrradiance = specularIrradiance; } half3 specularIrradianceReflections = 1.0; if (skylightingSpecular > 0.0) { specularIrradianceReflections = EnvReflectionsTexture.SampleLevel(LinearSampler, R, level).xyz; - specularIrradianceReflections = sRGB2Lin(specularIrradianceReflections); + specularIrradianceReflections = specularIrradianceReflections; } finalIrradiance = finalIrradiance * skylightingSpecular + lerp(specularIrradiance, specularIrradianceReflections, skylightingSpecular); # else half3 specularIrradianceReflections = EnvReflectionsTexture.SampleLevel(LinearSampler, R, level).xyz; - specularIrradianceReflections = sRGB2Lin(specularIrradianceReflections); + specularIrradianceReflections = specularIrradianceReflections; finalIrradiance += specularIrradianceReflections; # endif @@ -137,8 +135,6 @@ Texture2D SpecularSSGITexture : register(t10); # endif color += reflectance * finalIrradiance; - - color = Lin2sRGB(color); } #endif diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index fe4b06c37..8a03e559f 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -1578,6 +1578,8 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float3 screenSpaceNormal = normalize(WorldToView(worldSpaceNormal, false, eyeIndex)); # if defined(TRUE_PBR) + baseColor.xyz = Lin2sRGB(baseColor.xyz); + PBR::SurfaceProperties pbrSurfaceProperties; pbrSurfaceProperties.Roughness = saturate(rawRMAOS.x); @@ -1966,7 +1968,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(WETNESS_EFFECTS) if (waterRoughnessSpecular < 1.0) - wetnessSpecular += GetWetnessSpecular(wetnessNormal, normalizedDirLightDirectionWS, worldSpaceViewDirection, sRGB2Lin(dirLightColor * dirDetailShadow), waterRoughnessSpecular); + wetnessSpecular += GetWetnessSpecular(wetnessNormal, normalizedDirLightDirectionWS, worldSpaceViewDirection, dirLightColor * dirDetailShadow, waterRoughnessSpecular); # endif # endif @@ -2175,7 +2177,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(WETNESS_EFFECTS) if (waterRoughnessSpecular < 1.0) - wetnessSpecular += GetWetnessSpecular(wetnessNormal, normalizedLightDirection, worldSpaceViewDirection, sRGB2Lin(lightColor), waterRoughnessSpecular); + wetnessSpecular += GetWetnessSpecular(wetnessNormal, normalizedLightDirection, worldSpaceViewDirection, lightColor, waterRoughnessSpecular); # endif } # endif @@ -2228,13 +2230,8 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(SKYLIGHTING) float skylightingDiffuse = shFuncProductIntegral(skylightingSH, shEvaluateCosineLobe(skylightingSettings.DirectionalDiffuse ? worldSpaceNormal : float3(0, 0, 1))) / shPI; skylightingDiffuse = Skylighting::mixDiffuse(skylightingSettings, skylightingDiffuse); -# if !defined(TRUE_PBR) - directionalAmbientColor = sRGB2Lin(directionalAmbientColor); -# endif + directionalAmbientColor *= skylightingDiffuse; -# if !defined(TRUE_PBR) - directionalAmbientColor = Lin2sRGB(directionalAmbientColor); -# endif # endif # if defined(TRUE_PBR) && defined(LOD_LAND_BLEND) && !defined(DEFERRED) @@ -2264,7 +2261,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace dynamicCubemap = true; envColorBase = TexEnvSampler.SampleLevel(SampEnvSampler, float3(1.0, 0.0, 0.0), 0); if (envColorBase.a < 1.0) { - F0 = sRGB2Lin(envColorBase.rgb) + sRGB2Lin(baseColor.rgb); + F0 = envColorBase.rgb + baseColor.rgb; envRoughness = envColorBase.a; } else { F0 = 1.0; @@ -2275,7 +2272,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(CREATOR) if (cubemapCreatorSettings.Enabled) { dynamicCubemap = true; - F0 = sRGB2Lin(cubemapCreatorSettings.CubemapColor.rgb) + sRGB2Lin(baseColor.xyz); + F0 = cubemapCreatorSettings.CubemapColor.rgb + baseColor.xyz; envRoughness = cubemapCreatorSettings.CubemapColor.a; } # endif @@ -2284,7 +2281,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(EMAT) envRoughness = lerp(envRoughness, 1.0 - complexMaterialColor.y, (float)complexMaterial); envRoughness *= envRoughness; - F0 = lerp(F0, sRGB2Lin(complexSpecular), (float)complexMaterial); + F0 = lerp(F0, complexSpecular, (float)complexMaterial); # endif envColor = GetDynamicCubemap(screenUV, worldSpaceNormal, worldSpaceVertexNormal, worldSpaceViewDirection, envRoughness, F0, diffuseColor, viewPosition.z) * envMask; @@ -2413,7 +2410,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # else diffuseColor = 1.0; # endif - specularColor = sRGB2Lin(specularColor); } # endif @@ -2428,10 +2424,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # else specularColor += envColor * diffuseColor; # endif -# if defined(DYNAMIC_CUBEMAPS) - if (dynamicCubemap) - specularColor = Lin2sRGB(specularColor); -# endif # endif # if defined(EMAT) && defined(ENVMAP) @@ -2442,8 +2434,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if !defined(DEFERRED) color.xyz += specularColor; # endif - - color.xyz = sRGB2Lin(color.xyz); # endif # if defined(WETNESS_EFFECTS) && !defined(TRUE_PBR) @@ -2454,8 +2444,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace color.xyz += specularColorPBR; # endif - color.xyz = Lin2sRGB(color.xyz); - # if defined(LOD_LAND_BLEND) && defined(TRUE_PBR) { pbrWeight = 1 - lodLandBlendFactor; @@ -2465,7 +2453,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(DEFERRED) specularColorPBR = lerp(specularColorPBR, 0, lodLandBlendFactor); - indirectDiffuseLobeWeight = lerp(indirectDiffuseLobeWeight, sRGB2Lin(input.Color.xyz * lodLandColor * lodLandFadeFactor), lodLandBlendFactor); + indirectDiffuseLobeWeight = lerp(indirectDiffuseLobeWeight, input.Color.xyz * lodLandColor * lodLandFadeFactor, lodLandBlendFactor); indirectSpecularLobeWeight = lerp(indirectSpecularLobeWeight, 0, lodLandBlendFactor); pbrGlossiness = lerp(pbrGlossiness, 0, lodLandBlendFactor); # endif @@ -2606,13 +2594,13 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float3 outputSpecular = specularColor.xyz; # if defined(TRUE_PBR) - outputSpecular = Lin2sRGB(specularColorPBR.xyz); + outputSpecular = specularColorPBR.xyz; # endif psout.Specular = float4(outputSpecular, psout.Diffuse.w); float3 outputAlbedo = baseColor.xyz * vertexColor; # if defined(TRUE_PBR) - outputAlbedo = Lin2sRGB(indirectDiffuseLobeWeight); + outputAlbedo = indirectDiffuseLobeWeight; # endif psout.Albedo = float4(outputAlbedo, psout.Diffuse.w); diff --git a/package/Shaders/RunGrass.hlsl b/package/Shaders/RunGrass.hlsl index 9d7f2c150..e1057a4c3 100644 --- a/package/Shaders/RunGrass.hlsl +++ b/package/Shaders/RunGrass.hlsl @@ -638,8 +638,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace diffuseColor.xyz += transmissionColor; specularColor.xyz += specularColorPBR; - specularColor.xyz = Lin2sRGB(specularColor.xyz); - diffuseColor.xyz = Lin2sRGB(diffuseColor.xyz); # else # if !defined(SSGI) @@ -656,9 +654,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float skylighting = shFuncProductIntegral(skylightingSH, shEvaluateCosineLobe(skylightingSettings.DirectionalDiffuse ? normal : float3(0, 0, 1))) / shPI; skylighting = Skylighting::mixDiffuse(skylightingSettings, skylighting); - directionalAmbientColor = sRGB2Lin(directionalAmbientColor); directionalAmbientColor *= skylighting; - directionalAmbientColor = Lin2sRGB(directionalAmbientColor); # endif // SKYLIGHTING diffuseColor += directionalAmbientColor; @@ -689,7 +685,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float3 normalVS = normalize(WorldToView(normal, false, eyeIndex)); # if defined(TRUE_PBR) - psout.Albedo = float4(Lin2sRGB(indirectDiffuseLobeWeight), 1); + psout.Albedo = float4(indirectDiffuseLobeWeight, 1); psout.NormalGlossiness = float4(EncodeNormal(normalVS), 1 - pbrSurfaceProperties.Roughness, 1); psout.Reflectance = float4(indirectSpecularLobeWeight, 1); psout.Parameters = float4(0, 0, 1, 1);