|
@@ -67,8 +67,10 @@ varying vec2 vBumpUV;
|
|
|
varying vec3 vPositionW;
|
|
|
#ifdef NORMAL
|
|
|
varying vec3 vNormalW;
|
|
|
- #ifdef USESPHERICALFROMREFLECTIONMAP
|
|
|
+ #if defined(USESPHERICALFROMREFLECTIONMAP) && !defined(USESPHERICALINFRAGMENT)
|
|
|
varying vec3 vEnvironmentIrradiance;
|
|
|
+
|
|
|
+ #include<harmonicsFunctions>
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
@@ -94,8 +96,6 @@ varying vec3 vDirectionW;
|
|
|
|
|
|
#include<logDepthDeclaration>
|
|
|
|
|
|
-#include<harmonicsFunctions>
|
|
|
-
|
|
|
void main(void) {
|
|
|
vec3 positionUpdated = position;
|
|
|
#ifdef NORMAL
|
|
@@ -121,7 +121,7 @@ void main(void) {
|
|
|
|
|
|
#ifdef NORMAL
|
|
|
vNormalW = normalize(vec3(finalWorld * vec4(normalUpdated, 0.0)));
|
|
|
- #ifdef USESPHERICALFROMREFLECTIONMAP
|
|
|
+ #if defined(USESPHERICALFROMREFLECTIONMAP) && !defined(USESPHERICALINFRAGMENT)
|
|
|
vec3 reflectionVector = vec3(reflectionMatrix * vec4(vNormalW, 0)).xyz;
|
|
|
#ifdef REFLECTIONMAP_OPPOSITEZ
|
|
|
reflectionVector.z *= -1.0;
|