From 8accab4e67f66ecd66b6cc51593ccd7039f48acc Mon Sep 17 00:00:00 2001 From: Torsten Crass Date: Sat, 16 Sep 2023 16:40:11 +0200 Subject: [PATCH] Honour transparency of teleport beam color in shader. --- addons/godot-xr-tools/materials/teleport.gdshader | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/godot-xr-tools/materials/teleport.gdshader b/addons/godot-xr-tools/materials/teleport.gdshader index a51550b6..ad83a578 100644 --- a/addons/godot-xr-tools/materials/teleport.gdshader +++ b/addons/godot-xr-tools/materials/teleport.gdshader @@ -11,17 +11,17 @@ void vertex() { // offset our Z so we're projecting from our origin point VERTEX.z -= 0.5; VERTEX.z *= length; - + // now use that to create our arch float t = VERTEX.z * scale_t; float t2 = t * t; // translate to our world vector - VERTEX = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz; - + VERTEX = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz; + // and now create our arch VERTEX += down * t2; - + // and apply our view matrix VERTEX = (VIEW_MATRIX * vec4(VERTEX, 1.0)).xyz; } @@ -31,7 +31,7 @@ void fragment() { float offset = (TIME * 2.0); vec4 col = texture(arrow_texture, vec2(UV.x, (UV.y * length * 4.0) + offset )).rgba; ALBEDO = col.rgb * mix_color.rgb; - + // need to fix up our image and add an alpha channel - ALPHA = col.a; + ALPHA = min(col.a, mix_color.a); }