Permalink
Browse files

Added some default alpha logic for textures with alpha channels

  • Loading branch information...
1 parent 3804a42 commit 706241337a2c9c59740e5455eccbc9ffe231971a @cjcliffe committed Dec 11, 2010
Showing with 10 additions and 6 deletions.
  1. +10 −6 CubicVR_Core.fs
View
@@ -132,20 +132,24 @@ void main(void)
view_norm = (uPMatrix * vec4(n,0)).xyz;
#endif
+
+#if hasColorMap
+ color = vec4(mColor,1.0)*texture2D(colorMap, vec2(texCoord.s, texCoord.t)).rgba;
+ if (color.a<=0.1) discard;
+#else
+ color = vec4(mColor,1.0);
+#endif
+
#if hasAlphaMap
color.a = texture2D(alphaMap, texCoord).r;
if (color.a==0.0) discard;
#else
+#if hasAlpha
color.a = mAlpha;
#endif
-
-
-#if hasColorMap
- color = vec4(mColor*texture2D(colorMap, vec2(texCoord.s, texCoord.t)).rgb,1.0);
-#else
- color = vec4(mColor,1.0);
#endif
+
float envAmount = 0.6;
#if hasEnvSphereMap

0 comments on commit 7062413

Please sign in to comment.