|
@@ -4,13 +4,14 @@ uniform vec3 emissive;
|
|
uniform float opacity;
|
|
uniform float opacity;
|
|
|
|
|
|
varying vec3 vLightFront;
|
|
varying vec3 vLightFront;
|
|
|
|
+varying vec3 vIndirectFront;
|
|
|
|
|
|
#ifdef DOUBLE_SIDED
|
|
#ifdef DOUBLE_SIDED
|
|
-
|
|
|
|
varying vec3 vLightBack;
|
|
varying vec3 vLightBack;
|
|
-
|
|
|
|
|
|
+ varying vec3 vIndirectBack;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+
|
|
#include <common>
|
|
#include <common>
|
|
#include <packing>
|
|
#include <packing>
|
|
#include <dithering_pars_fragment>
|
|
#include <dithering_pars_fragment>
|
|
@@ -51,6 +52,16 @@ void main() {
|
|
// accumulation
|
|
// accumulation
|
|
reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );
|
|
reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );
|
|
|
|
|
|
|
|
+ #ifdef DOUBLE_SIDED
|
|
|
|
+
|
|
|
|
+ reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;
|
|
|
|
+
|
|
|
|
+ #else
|
|
|
|
+
|
|
|
|
+ reflectedLight.indirectDiffuse += vIndirectFront;
|
|
|
|
+
|
|
|
|
+ #endif
|
|
|
|
+
|
|
#include <lightmap_fragment>
|
|
#include <lightmap_fragment>
|
|
|
|
|
|
reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );
|
|
reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );
|
|
@@ -81,6 +92,5 @@ void main() {
|
|
#include <fog_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
#include <dithering_fragment>
|
|
-
|
|
|
|
}
|
|
}
|
|
`;
|
|
`;
|