|
@@ -18,23 +18,27 @@ attribute vec3 inPosition;
|
|
|
attribute vec2 inTexCoord;
|
|
|
attribute vec3 inNormal;
|
|
|
|
|
|
-#ifdef VERTEX_COLOR
|
|
|
- attribute vec4 inColor;
|
|
|
+#if defined (VERTEX_COLOR) || defined(USE_VERTEX_COLORS_AS_SUN_INTENSITY)
|
|
|
+ attribute vec4 inColor;
|
|
|
+#endif
|
|
|
+
|
|
|
+#if defined(USE_VERTEX_COLORS_AS_SUN_INTENSITY)
|
|
|
+ varying vec4 vertColors;
|
|
|
#endif
|
|
|
|
|
|
varying vec3 wNormal;
|
|
|
varying vec3 wPosition;
|
|
|
-#if defined(NORMALMAP) || defined(PARALLAXMAP)
|
|
|
- attribute vec4 inTangent;
|
|
|
- varying vec4 wTangent;
|
|
|
-#endif
|
|
|
+
|
|
|
+attribute vec4 inTangent;
|
|
|
+varying vec4 wTangent;
|
|
|
|
|
|
void main(){
|
|
|
vec4 modelSpacePos = vec4(inPosition, 1.0);
|
|
|
vec3 modelSpaceNorm = inNormal;
|
|
|
+ vec3 modelSpaceTan = inTangent.xyz;
|
|
|
|
|
|
- #if ( defined(NORMALMAP) || defined(PARALLAXMAP)) && !defined(VERTEX_LIGHTING)
|
|
|
- vec3 modelSpaceTan = inTangent.xyz;
|
|
|
+ #ifdef USE_VERTEX_COLORS_AS_SUN_INTENSITY
|
|
|
+ vertColors = inColor;
|
|
|
#endif
|
|
|
|
|
|
#ifdef NUM_MORPH_TARGETS
|
|
@@ -61,10 +65,7 @@ void main(){
|
|
|
|
|
|
wPosition = TransformWorld(modelSpacePos).xyz;
|
|
|
wNormal = TransformWorldNormal(modelSpaceNorm);
|
|
|
-
|
|
|
- #if defined(NORMALMAP) || defined(PARALLAXMAP)
|
|
|
- wTangent = vec4(TransformWorldNormal(modelSpaceTan),inTangent.w);
|
|
|
- #endif
|
|
|
+ wTangent = vec4(TransformWorldNormal(modelSpaceTan),inTangent.w);
|
|
|
|
|
|
Color = m_BaseColor;
|
|
|
|