first commit

This commit is contained in:
Daniel Snider 2025-04-18 01:41:24 -07:00
commit 7eebf4e2d7
8 changed files with 150 additions and 0 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/

1
icon.svg Normal file
View File

@ -0,0 +1 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 813 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H447l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c3 34 55 34 58 0v-86c-3-34-55-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>

After

Width:  |  Height:  |  Size: 949 B

37
icon.svg.import Normal file
View File

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://csyjb53nj0273"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

36
main.tscn Normal file
View File

@ -0,0 +1,36 @@
[gd_scene load_steps=3 format=3 uid="uid://bmh3d4xt71wx5"]
[ext_resource type="Shader" uid="uid://brqn8rgcnleng" path="res://stairs.gdshader" id="1_ig7tw"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ig7tw"]
shader = ExtResource("1_ig7tw")
shader_parameter/step_count = 168
shader_parameter/inner = 101
shader_parameter/pixel_size = 121
shader_parameter/highlight = 0
shader_parameter/grid_thickness = 0.125
shader_parameter/offset = 0.0
[node name="Main" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="ColorRect" type="ColorRect" parent="."]
material = SubResource("ShaderMaterial_ig7tw")
custom_minimum_size = Vector2(128, 128)
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -324.0
offset_top = -324.0
offset_right = 324.0
offset_bottom = 324.0
grow_horizontal = 2
grow_vertical = 2

15
project.godot Normal file
View File

@ -0,0 +1,15 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="stairs"
config/features=PackedStringArray("4.4")
config/icon="res://icon.svg"

56
stairs.gdshader Normal file
View File

@ -0,0 +1,56 @@
shader_type canvas_item;
uniform int step_count = 168;
uniform int inner = 101;
uniform int pixel_size = 121;
uniform int highlight = 0;
uniform float grid_thickness = 0.125;
uniform float offset = 0.0;
float mask(float inner_radius, float outer_radius, vec2 p) {
if (inner_radius < length(p) && length(p) < outer_radius) {
return 1.0;
} else {
return 0.0;
}
}
float f(vec2 uv, vec2 p) {
float angle = atan(p.y, p.x) / PI / 2.0 + 0.5 + offset/float(step_count);
float color = round(angle * float(step_count)) / float(step_count);
return color;
}
float grid_mask(vec2 uv) {
float x = mod(uv.x*float(pixel_size), 1.0);
float y = mod(uv.y*float(pixel_size), 1.0);
return step(grid_thickness, x)* step(grid_thickness, y);
}
void fragment() {
vec2 p = UV - vec2(0.5, 0.5);
p = round(p * float(pixel_size)) / float(pixel_size);
float color = f(UV, p);
//color *= edge_mask(UV, vec2(0.002, 0.002));
vec3 chroma = vec3(color, color, color);
int i = int(color * float(step_count));
if (i == highlight) {
chroma = vec3(0.0, 1.0, 0.0);
} else if (i % 2 == 0) {
chroma = vec3(0.3, 0.3, 0.3);
} else if (i % 2 == 1) {
chroma = vec3(0.6, 0.6, 0.6);
}
chroma *= grid_mask(UV);
chroma *= mask(float(inner) / float(pixel_size * 2), 0.5, p);
COLOR = vec4(chroma, 1.0);
}
//void light() {
// // Called for every pixel for every light affecting the CanvasItem.
// // Uncomment to replace the default light processing function with this one.
//}

1
stairs.gdshader.uid Normal file
View File

@ -0,0 +1 @@
uid://brqn8rgcnleng