diff --git a/fyrox-impl/src/renderer/shaders/ambient_light.shader b/fyrox-impl/src/renderer/shaders/ambient_light.shader index 7cdc92543..ae69390d0 100644 --- a/fyrox-impl/src/renderer/shaders/ambient_light.shader +++ b/fyrox-impl/src/renderer/shaders/ambient_light.shader @@ -134,7 +134,7 @@ ivec2 cubeMapSize = textureSize(prefilteredSpecularMap, 0); float mip = roughness * (floor(log2(float(cubeMapSize.x))) + 1.0); - vec3 reflection = properties.skyboxLighting ? textureLod(prefilteredSpecularMap, reflectionVector, mip).rgb : properties.ambientColor.rgb; + vec3 reflection = properties.skyboxLighting ? S_SRGBToLinear(textureLod(prefilteredSpecularMap, reflectionVector, mip)).rgb : properties.ambientColor.rgb; vec3 F0 = mix(vec3(0.04), albedo.rgb, metallic); vec3 F = S_FresnelSchlickRoughness(clampedCosViewAngle, F0, roughness); @@ -146,7 +146,7 @@ float ambientOcclusion = texture(aoSampler, texCoord).r * materialAo; vec4 bakedLighting = texture(bakedLightingTexture, texCoord); - vec3 irradiance = texture(irradianceMap, fragmentNormal).rgb; + vec3 irradiance = S_SRGBToLinear(texture(irradianceMap, fragmentNormal)).rgb; vec3 diffuse = (properties.skyboxLighting ? irradiance : properties.ambientColor.rgb) * albedo.rgb; FragColor.rgb = bakedLighting.rgb + (kD * diffuse + specular) * ambientOcclusion;