From 2747067f6188d0e4f845c6ceb5d39a33ab193b87 Mon Sep 17 00:00:00 2001 From: radius Date: Sun, 3 Dec 2017 15:10:24 -0500 Subject: [PATCH] this probably fixes the shader on noveau and others --- .../gl_shaders/pipeline_snowflake.glsl.frag.h | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/gfx/drivers/gl_shaders/pipeline_snowflake.glsl.frag.h b/gfx/drivers/gl_shaders/pipeline_snowflake.glsl.frag.h index a5426710baf..1b048d2223f 100644 --- a/gfx/drivers/gl_shaders/pipeline_snowflake.glsl.frag.h +++ b/gfx/drivers/gl_shaders/pipeline_snowflake.glsl.frag.h @@ -6,29 +6,40 @@ static const char* stock_fragment_xmb_snowflake = GLSL( uniform float time; - uniform float atime; uniform vec2 OutputSize; vec2 uv; + float atime; + float rand(vec2 co) { return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); } - float rand(float x){ return rand(vec2(x,1.0));} + float rand_float(float x) + { + return rand(vec2(x, 1.0)); + } float snow(vec3 pos, vec2 uv, float o) { vec2 d = (pos.xy - uv); - float a = atan(d.y,d.x)+sin(atime*1.+o)*10.; + float a = atan(d.y,d.x) + sin(atime*1.0 + o) * 10.0; float dist = d.x*d.x + d.y*d.y; - if(dist < pos.z/400.){ + if(dist < pos.z/400.0) + { float col = 0.0; - if(sin(a*8.) < 0.0){col=1.0;} - if(dist