|
@@ -161,36 +161,60 @@ varying vec3 lightVec;
|
|
#endif
|
|
#endif
|
|
#ifdef DIFFUSEMAP
|
|
#ifdef DIFFUSEMAP
|
|
diffuseColor = texture2D(m_DiffuseMap, texCoord * m_DiffuseMap_0_scale);
|
|
diffuseColor = texture2D(m_DiffuseMap, texCoord * m_DiffuseMap_0_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend.r *= diffuseColor.a;
|
|
|
|
+ #endif
|
|
diffuseColor *= alphaBlend.r;
|
|
diffuseColor *= alphaBlend.r;
|
|
#endif
|
|
#endif
|
|
#ifdef DIFFUSEMAP_1
|
|
#ifdef DIFFUSEMAP_1
|
|
vec4 diffuseColor1 = texture2D(m_DiffuseMap_1, texCoord * m_DiffuseMap_1_scale);
|
|
vec4 diffuseColor1 = texture2D(m_DiffuseMap_1, texCoord * m_DiffuseMap_1_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend.g *= diffuseColor1.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor1, alphaBlend.g );
|
|
diffuseColor = mix( diffuseColor, diffuseColor1, alphaBlend.g );
|
|
#endif
|
|
#endif
|
|
#ifdef DIFFUSEMAP_2
|
|
#ifdef DIFFUSEMAP_2
|
|
vec4 diffuseColor2 = texture2D(m_DiffuseMap_2, texCoord * m_DiffuseMap_2_scale);
|
|
vec4 diffuseColor2 = texture2D(m_DiffuseMap_2, texCoord * m_DiffuseMap_2_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend.b *= diffuseColor2.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor2, alphaBlend.b );
|
|
diffuseColor = mix( diffuseColor, diffuseColor2, alphaBlend.b );
|
|
#endif
|
|
#endif
|
|
#ifdef DIFFUSEMAP_3
|
|
#ifdef DIFFUSEMAP_3
|
|
vec4 diffuseColor3 = texture2D(m_DiffuseMap_3, texCoord * m_DiffuseMap_3_scale);
|
|
vec4 diffuseColor3 = texture2D(m_DiffuseMap_3, texCoord * m_DiffuseMap_3_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend.a *= diffuseColor3.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor3, alphaBlend.a );
|
|
diffuseColor = mix( diffuseColor, diffuseColor3, alphaBlend.a );
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef ALPHAMAP_1
|
|
#ifdef ALPHAMAP_1
|
|
#ifdef DIFFUSEMAP_4
|
|
#ifdef DIFFUSEMAP_4
|
|
vec4 diffuseColor4 = texture2D(m_DiffuseMap_4, texCoord * m_DiffuseMap_4_scale);
|
|
vec4 diffuseColor4 = texture2D(m_DiffuseMap_4, texCoord * m_DiffuseMap_4_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend1.r *= diffuseColor4.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor4, alphaBlend1.r );
|
|
diffuseColor = mix( diffuseColor, diffuseColor4, alphaBlend1.r );
|
|
#endif
|
|
#endif
|
|
#ifdef DIFFUSEMAP_5
|
|
#ifdef DIFFUSEMAP_5
|
|
vec4 diffuseColor5 = texture2D(m_DiffuseMap_5, texCoord * m_DiffuseMap_5_scale);
|
|
vec4 diffuseColor5 = texture2D(m_DiffuseMap_5, texCoord * m_DiffuseMap_5_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend1.g *= diffuseColor5.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor5, alphaBlend1.g );
|
|
diffuseColor = mix( diffuseColor, diffuseColor5, alphaBlend1.g );
|
|
#endif
|
|
#endif
|
|
#ifdef DIFFUSEMAP_6
|
|
#ifdef DIFFUSEMAP_6
|
|
vec4 diffuseColor6 = texture2D(m_DiffuseMap_6, texCoord * m_DiffuseMap_6_scale);
|
|
vec4 diffuseColor6 = texture2D(m_DiffuseMap_6, texCoord * m_DiffuseMap_6_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend1.b *= diffuseColor6.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor6, alphaBlend1.b );
|
|
diffuseColor = mix( diffuseColor, diffuseColor6, alphaBlend1.b );
|
|
#endif
|
|
#endif
|
|
#ifdef DIFFUSEMAP_7
|
|
#ifdef DIFFUSEMAP_7
|
|
vec4 diffuseColor7 = texture2D(m_DiffuseMap_7, texCoord * m_DiffuseMap_7_scale);
|
|
vec4 diffuseColor7 = texture2D(m_DiffuseMap_7, texCoord * m_DiffuseMap_7_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend1.a *= diffuseColor7.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor7, alphaBlend1.a );
|
|
diffuseColor = mix( diffuseColor, diffuseColor7, alphaBlend1.a );
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
@@ -198,18 +222,30 @@ varying vec3 lightVec;
|
|
#ifdef ALPHAMAP_2
|
|
#ifdef ALPHAMAP_2
|
|
#ifdef DIFFUSEMAP_8
|
|
#ifdef DIFFUSEMAP_8
|
|
vec4 diffuseColor8 = texture2D(m_DiffuseMap_8, texCoord * m_DiffuseMap_8_scale);
|
|
vec4 diffuseColor8 = texture2D(m_DiffuseMap_8, texCoord * m_DiffuseMap_8_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend2.r *= diffuseColor8.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor8, alphaBlend2.r );
|
|
diffuseColor = mix( diffuseColor, diffuseColor8, alphaBlend2.r );
|
|
#endif
|
|
#endif
|
|
#ifdef DIFFUSEMAP_9
|
|
#ifdef DIFFUSEMAP_9
|
|
vec4 diffuseColor9 = texture2D(m_DiffuseMap_9, texCoord * m_DiffuseMap_9_scale);
|
|
vec4 diffuseColor9 = texture2D(m_DiffuseMap_9, texCoord * m_DiffuseMap_9_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend2.g *= diffuseColor9.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor9, alphaBlend2.g );
|
|
diffuseColor = mix( diffuseColor, diffuseColor9, alphaBlend2.g );
|
|
#endif
|
|
#endif
|
|
#ifdef DIFFUSEMAP_10
|
|
#ifdef DIFFUSEMAP_10
|
|
vec4 diffuseColor10 = texture2D(m_DiffuseMap_10, texCoord * m_DiffuseMap_10_scale);
|
|
vec4 diffuseColor10 = texture2D(m_DiffuseMap_10, texCoord * m_DiffuseMap_10_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend2.b *= diffuseColor10.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor10, alphaBlend2.b );
|
|
diffuseColor = mix( diffuseColor, diffuseColor10, alphaBlend2.b );
|
|
#endif
|
|
#endif
|
|
#ifdef DIFFUSEMAP_11
|
|
#ifdef DIFFUSEMAP_11
|
|
vec4 diffuseColor11 = texture2D(m_DiffuseMap_11, texCoord * m_DiffuseMap_11_scale);
|
|
vec4 diffuseColor11 = texture2D(m_DiffuseMap_11, texCoord * m_DiffuseMap_11_scale);
|
|
|
|
+ #ifdef USE_ALPHA
|
|
|
|
+ alphaBlend2.a *= diffuseColor11.a;
|
|
|
|
+ #endif
|
|
diffuseColor = mix( diffuseColor, diffuseColor11, alphaBlend2.a );
|
|
diffuseColor = mix( diffuseColor, diffuseColor11, alphaBlend2.a );
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
@@ -616,4 +652,4 @@ void main(){
|
|
SpecularSum * specularColor * light.y;
|
|
SpecularSum * specularColor * light.y;
|
|
|
|
|
|
//gl_FragColor.a = alpha;
|
|
//gl_FragColor.a = alpha;
|
|
-}
|
|
|
|
|
|
+}
|