This commit is contained in:
Luca 2025-01-02 10:46:25 +01:00
parent 2219e943da
commit c4115b3569
40 changed files with 2035 additions and 19 deletions

View file

@ -0,0 +1,17 @@
shader_type spatial;
render_mode cull_disabled;
/*
We define the center position of our circle and then ask each pixel how far from that
center position it is. This will give the pixel a value between 0 1.
We can then ask the pixel if its value is lower or higher than a predefined value.
If it is higher we will set the pixel to white
and if it is lower we will set it to black.
*/
float circle(vec2 position, float radius, float feather) {
return smoothstep(radius, radius + feather, length(position - vec2(0.5)));
}
void fragment() {
ALBEDO.rgb = vec3( circle(UV, 0.3, 0.0) );
}

View file

@ -0,0 +1,15 @@
[gd_scene load_steps=4 format=3 uid="uid://cjcfr8tqdhbro"]
[ext_resource type="Shader" path="res://shaders/011_circle/circle.gdshader" id="1_omahb"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_iu8hm"]
render_priority = 0
shader = ExtResource("1_omahb")
[sub_resource type="QuadMesh" id="QuadMesh_md0p6"]
material = SubResource("ShaderMaterial_iu8hm")
[node name="Circle" type="Node3D"]
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("QuadMesh_md0p6")