Expose ambient intensity value for globes as a property

This commit is contained in:
Malin E
2022-09-28 12:03:41 +02:00
parent 0bf06427e2
commit 866b37fac3
4 changed files with 19 additions and 4 deletions
@@ -55,6 +55,7 @@ uniform vec3 lightDirectionCameraSpace;
#if PERFORM_SHADING
uniform float orenNayarRoughness;
uniform float ambientIntensity;
#endif // PERFORM_SHADING
#if SHADOW_MAPPING_ENABLED
@@ -205,7 +206,8 @@ Fragment getFragment() {
normal,
lightDirectionCameraSpace,
normalize(positionCameraSpace),
orenNayarRoughness
orenNayarRoughness,
ambientIntensity
);
#endif // PERFORM_SHADING
@@ -374,9 +374,9 @@ vec4 calculateNight(vec4 currentColor, vec2 uv, vec3 levelWeights,
vec4 calculateShadedColor(vec4 currentColor, vec3 ellipsoidNormalCameraSpace,
vec3 lightDirectionCameraSpace, vec3 viewDirectionCameraSpace,
float roughness)
float roughness, float ambientIntensity)
{
vec3 shadedColor = currentColor.rgb * 0.05;
vec3 shadedColor = currentColor.rgb * ambientIntensity;
vec3 n = normalize(ellipsoidNormalCameraSpace);