From 30c711920f49528e281d3c4d9d51b5b0f3020ff1 Mon Sep 17 00:00:00 2001 From: Rodolphe Suescun Date: Tue, 7 Aug 2018 09:24:48 +0200 Subject: [PATCH] Fixed pattern node Triangle was stupidly named saw, sawtooth was missing --- addons/procedural_material/common.shader | 2 +- addons/procedural_material/nodes/pattern.gd | 2 +- addons/procedural_material/nodes/pattern.tscn | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/procedural_material/common.shader b/addons/procedural_material/common.shader index e912d38..f235cc4 100644 --- a/addons/procedural_material/common.shader +++ b/addons/procedural_material/common.shader @@ -17,7 +17,7 @@ float wave_sin(float x) { return 0.5-0.5*cos(3.1415928*2.0*x); } -float wave_saw(float x) { +float wave_triangle(float x) { x = fract(x); return min(2.0*x, 2.0-2.0*x); } diff --git a/addons/procedural_material/nodes/pattern.gd b/addons/procedural_material/nodes/pattern.gd index 7a7ec12..9df59c8 100644 --- a/addons/procedural_material/nodes/pattern.gd +++ b/addons/procedural_material/nodes/pattern.gd @@ -7,7 +7,7 @@ var x_scale = 4.0 var y_wave = 0 var y_scale = 4.0 -const WAVE_FCT = [ "wave_sin", "wave_saw", "wave_square" ] +const WAVE_FCT = [ "wave_sin", "wave_triangle", "wave_square", "fract" ] const MIX_FCT = [ "mix_multiply", "mix_add", "mix_max", "mix_min", "mix_xor", "mix_pow" ] func _ready(): diff --git a/addons/procedural_material/nodes/pattern.tscn b/addons/procedural_material/nodes/pattern.tscn index e4d969b..d260e00 100644 --- a/addons/procedural_material/nodes/pattern.tscn +++ b/addons/procedural_material/nodes/pattern.tscn @@ -181,7 +181,7 @@ group = null text = "Sine" flat = false align = 0 -items = [ "Sine", null, false, 0, null, "Saw", null, false, 1, null, "Square", null, false, 2, null ] +items = [ "Sine", null, false, 0, null, "Triangle", null, false, 1, null, "Square", null, false, 2, null, "Sawtooth", null, false, 3, null ] selected = 0 _sections_unfolded = [ "Rect" ] @@ -276,7 +276,7 @@ group = null text = "Sine" flat = false align = 0 -items = [ "Sine", null, false, 0, null, "Saw", null, false, 1, null, "Square", null, false, 2, null ] +items = [ "Sine", null, false, 0, null, "Triangle", null, false, 1, null, "Square", null, false, 2, null, "Sawtooth", null, false, 3, null ] selected = 0 _sections_unfolded = [ "Rect" ]