Tweak shader randomly a bit
authorPerttu Ahola <celeron55@gmail.com>
Sun, 2 Dec 2012 21:08:46 +0000 (23:08 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sun, 2 Dec 2012 21:47:53 +0000 (23:47 +0200)
client/shaders/test_shader_1/opengl_vertex.glsl

index e24f58c099b254098aa80e25e1510bbdd7203783..3cf1f122b3de9e0a9e30536b2825922a51a9b47b 100644 (file)
@@ -43,8 +43,12 @@ void main(void)
        color.g = rg;\r
        color.b = b;\r
 \r
+       // Make sides and bottom darker than the top\r
+       color = color * color; // SRGB -> Linear\r
        if(gl_Normal.y <= 0.5)\r
-               color *= 0.7;\r
+               color *= 0.6;\r
+               //color *= 0.7;\r
+       color = sqrt(color); // Linear -> SRGB\r
 \r
        color.a = gl_Color.a;\r
 \r