mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:25:52 +02:00
FIxing the bad ambient lighting on scattering surfaces
This commit is contained in:
parent
5b63c0523d
commit
522c577e73
1 changed files with 2 additions and 2 deletions
|
@ -78,7 +78,7 @@ void evalLightingAmbient(out vec3 diffuse, out vec3 specular, LightAmbient ambie
|
||||||
vec3 ambientSpaceSurfaceNormal = (ambient.transform * vec4(surface.normal, 0.0)).xyz;
|
vec3 ambientSpaceSurfaceNormal = (ambient.transform * vec4(surface.normal, 0.0)).xyz;
|
||||||
vec3 ambientSpaceSurfaceEyeDir = (ambient.transform * vec4(surface.eyeDir, 0.0)).xyz;
|
vec3 ambientSpaceSurfaceEyeDir = (ambient.transform * vec4(surface.eyeDir, 0.0)).xyz;
|
||||||
<@if supportScattering@>
|
<@if supportScattering@>
|
||||||
vec3 ambientSpaceLowNormalCurvature = (ambient.transform * lowNormalCurvature).xyz;
|
vec3 ambientSpaceLowNormal = (ambient.transform * vec4(lowNormalCurvature.xyz, 0.0)).xyz;
|
||||||
<@endif@>
|
<@endif@>
|
||||||
|
|
||||||
vec3 ambientFresnel = fresnelSchlickAmbient(fresnelF0, surface.ndotv, 1.0-surface.roughness);
|
vec3 ambientFresnel = fresnelSchlickAmbient(fresnelF0, surface.ndotv, 1.0-surface.roughness);
|
||||||
|
@ -99,7 +99,7 @@ void evalLightingAmbient(out vec3 diffuse, out vec3 specular, LightAmbient ambie
|
||||||
obscurance = min(obscurance, ambientOcclusion);
|
obscurance = min(obscurance, ambientOcclusion);
|
||||||
|
|
||||||
// Diffuse from ambient
|
// Diffuse from ambient
|
||||||
diffuse = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), ambientSpaceLowNormalCurvature).xyz;
|
diffuse = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), ambientSpaceLowNormal).xyz;
|
||||||
|
|
||||||
// Scattering ambient specular is the same as non scattering for now
|
// Scattering ambient specular is the same as non scattering for now
|
||||||
// TODO: we should use the same specular answer as for direct lighting
|
// TODO: we should use the same specular answer as for direct lighting
|
||||||
|
|
Loading…
Reference in a new issue