|
@@ -4,13 +4,18 @@ uniform vec3 emissive;
|
|
uniform float opacity;
|
|
uniform float opacity;
|
|
|
|
|
|
varying vec3 vLightFront;
|
|
varying vec3 vLightFront;
|
|
|
|
+#if defined(USE_SHADOWMAP) && NUM_HEMI_LIGHTS > 0
|
|
|
|
+ varying vec3 vAmbientLightFront;
|
|
|
|
+#endif
|
|
|
|
|
|
#ifdef DOUBLE_SIDED
|
|
#ifdef DOUBLE_SIDED
|
|
-
|
|
|
|
varying vec3 vLightBack;
|
|
varying vec3 vLightBack;
|
|
-
|
|
|
|
|
|
+ #if defined(USE_SHADOWMAP) && NUM_HEMI_LIGHTS > 0
|
|
|
|
+ varying vec3 vAmbientLightBack;
|
|
|
|
+ #endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+
|
|
#include <common>
|
|
#include <common>
|
|
#include <packing>
|
|
#include <packing>
|
|
#include <dithering_pars_fragment>
|
|
#include <dithering_pars_fragment>
|
|
@@ -51,6 +56,18 @@ void main() {
|
|
// accumulation
|
|
// accumulation
|
|
reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );
|
|
reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );
|
|
|
|
|
|
|
|
+ #if defined(USE_SHADOWMAP) && NUM_HEMI_LIGHTS > 0
|
|
|
|
+ #ifdef DOUBLE_SIDED
|
|
|
|
+
|
|
|
|
+ reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vAmbientLightFront : vAmbientLightBack;
|
|
|
|
+
|
|
|
|
+ #else
|
|
|
|
+
|
|
|
|
+ reflectedLight.indirectDiffuse += vAmbientLightFront;
|
|
|
|
+
|
|
|
|
+ #endif
|
|
|
|
+ #endif
|
|
|
|
+
|
|
#include <lightmap_fragment>
|
|
#include <lightmap_fragment>
|
|
|
|
|
|
reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );
|
|
reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );
|
|
@@ -81,6 +98,5 @@ void main() {
|
|
#include <fog_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
#include <dithering_fragment>
|
|
-
|
|
|
|
}
|
|
}
|
|
`;
|
|
`;
|