online multiplayer chess game (note server currently down)
Diffstat (limited to 'Square.tscn')
| -rw-r--r-- | Square.tscn | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Square.tscn b/Square.tscn index 145452c..0a6d13a 100644 --- a/Square.tscn +++ b/Square.tscn @@ -28,6 +28,29 @@ shader = SubResource( 2 ) shader_param/amt = 1.0 shader_param/color = Color( 0.431373, 0.584314, 0.388235, 0.639216 ) +[sub_resource type="Shader" id=2] +code = "shader_type canvas_item; + +uniform float amt : hint_range(0.0, 1.0); +uniform vec4 color : hint_color; + +void fragment() +{ + if (distance(UV, vec2(0.5,0.5)) > amt/2.0) + { + COLOR = vec4(0.0); + } + else + { + COLOR = vec4(color); + } +}" + +[sub_resource type="ShaderMaterial" id=3] +shader = SubResource( 2 ) +shader_param/amt = 1.0 +shader_param/color = Color( 0.431373, 0.584314, 0.388235, 0.639216 ) + [node name="Square" type="ColorRect"] anchor_right = 1.0 anchor_bottom = 1.0 |