chiark / gitweb /
Fix shader code (caused exception on mac)
authordaid303 <daid303@gmail.com>
Wed, 3 Apr 2013 14:09:06 +0000 (16:09 +0200)
committerdaid303 <daid303@gmail.com>
Wed, 3 Apr 2013 14:09:06 +0000 (16:09 +0200)
Cura/gui/sceneView.py

index fbe948167a0f3150a5ecae41269fdfd86fd3bb83..9bcc6d21a1136658f7c7ecb7ce9838bef80f5f5f 100644 (file)
@@ -362,8 +362,8 @@ varying float light_amount;
 void main(void)
 {
        vec4 tmp = gl_Vertex;
-    tmp.x += sin(tmp.z/5+intensity*30) * scale * intensity;
-    tmp.y += sin(tmp.z/3+intensity*40) * scale * intensity;
+    tmp.x += sin(tmp.z/5.0+intensity*30.0) * scale * intensity;
+    tmp.y += sin(tmp.z/3.0+intensity*40.0) * scale * intensity;
     gl_Position = gl_ModelViewProjectionMatrix * tmp;
     gl_FrontColor = gl_Color;
 
@@ -378,7 +378,7 @@ varying float light_amount;
 
 void main(void)
 {
-       gl_FragColor = vec4(gl_Color.xyz * light_amount, 1-intensity);
+       gl_FragColor = vec4(gl_Color.xyz * light_amount, 1.0-intensity);
 }
                        """)
                self._init3DView()