From 65870682960ea4b4ecd6499895ba6c84a6c8b7d1 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Wed, 4 Sep 2019 17:39:25 +0200 Subject: [PATCH] Fix GLSL shader compilation with certain graphics drivers (fixes #1325) (#1624) --- src/main/resources/assets/bloodmagic/shaders/beam-broken.frag | 2 +- src/main/resources/assets/bloodmagic/shaders/beam.frag | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/assets/bloodmagic/shaders/beam-broken.frag b/src/main/resources/assets/bloodmagic/shaders/beam-broken.frag index 63693c95..e3b2e255 100644 --- a/src/main/resources/assets/bloodmagic/shaders/beam-broken.frag +++ b/src/main/resources/assets/bloodmagic/shaders/beam-broken.frag @@ -4,7 +4,7 @@ void main() { vec2 texcoord = vec2(gl_TexCoord[0]); vec4 color = texture2D(bgl_RenderedTexture, texcoord); - float r = sin(texcoord.x * 6 - 1.5 + sin(texcoord.y - time / 3.0)) * 1.1; //(sin((texcoord.x - texcoord.y) * 4 - time) + 1) / 2; + float r = sin(texcoord.x * 6.0 - 1.5 + sin(texcoord.y - float(time) / 3.0)) * 1.1; //(sin((texcoord.x - texcoord.y) * 4 - time) + 1) / 2; gl_FragColor = vec4(min(1 - r, color.r * gl_Color.r), min(1 - r, color.g * gl_Color.g), color.b * gl_Color.b, color.a * gl_Color.a); } diff --git a/src/main/resources/assets/bloodmagic/shaders/beam.frag b/src/main/resources/assets/bloodmagic/shaders/beam.frag index 62741dfc..2ccc5dcd 100644 --- a/src/main/resources/assets/bloodmagic/shaders/beam.frag +++ b/src/main/resources/assets/bloodmagic/shaders/beam.frag @@ -5,8 +5,8 @@ vec2 texcoord = vec2(gl_TexCoord[0]); vec4 color = texture2D(bgl_RenderedTexture, texcoord); - float gs = (color.r + color.g + color.b) / 3; - float r = sin(texcoord.x * 6 - 1.5 + sin(texcoord.y - time / 3.0)) * 1.1; //(sin((texcoord.x - texcoord.y) * 4 - time) + 1) / 2; + float gs = (color.r + color.g + color.b) / 3.0; + float r = sin(texcoord.x * 6.0 - 1.5 + sin(texcoord.y - float(time) / 3.0)) * 1.1; //(sin((texcoord.x - texcoord.y) * 4 - time) + 1) / 2; gl_FragColor = vec4(gs, gs, max(gs, r), gl_Color.a); }