From 3f114ebe5c4d3618504b0e623b52c22e262de854 Mon Sep 17 00:00:00 2001 From: soaos Date: Tue, 12 Aug 2025 23:17:55 -0400 Subject: Moved public files to root --- .gitea/workflows/deploy.yaml | 22 -- .vscode/settings.json | 9 - CNAME | 1 + blog/blacklight_shader/blacklight.png | Bin 0 -> 846587 bytes blog/blacklight_shader/index.html | 227 +++++++++++++++++++ content/_index.md | 20 -- content/blog/_index.md | 6 - content/blog/mons_i/base.png | Bin 223768 -> 0 bytes content/blog/mons_i/first_triangle.png | Bin 3480 -> 0 bytes content/blog/mons_i/index.md | 249 --------------------- content/blog/mons_i/mesh.png | Bin 81687 -> 0 bytes content/blog/mons_i/mons.png | Bin 1724 -> 0 bytes content/blog/mons_i/normalmap.png | Bin 792980 -> 0 bytes content/blog/mons_i/texture.png | Bin 72688 -> 0 bytes content/blog/new-website.md | 67 ------ content/projects/_index.md | 5 - content/projects/bevy_blacklight_material/index.md | 16 -- content/projects/bevy_dither_post_process/index.md | 29 --- .../projects/bevy_dither_post_process/level_2.png | Bin 59120 -> 0 bytes .../projects/bevy_dither_post_process/level_3.png | Bin 60434 -> 0 bytes .../projects/bevy_dither_post_process/level_4.png | Bin 59292 -> 0 bytes content/projects/bevy_headless_render/index.md | 13 -- .../projects/bevy_outline_post_process/index.md | 28 --- .../bevy_outline_post_process/threshold_10.png | Bin 166203 -> 0 bytes .../threshold_10_adaptive.png | Bin 169214 -> 0 bytes .../threshold_10_thick.png | Bin 127530 -> 0 bytes .../threshold_10_thin.png | Bin 194280 -> 0 bytes content/projects/bevy_rustysynth/index.md | 12 - content/projects/bevy_terminal_display/dialog.png | Bin 38779 -> 0 bytes content/projects/bevy_terminal_display/index.md | 28 --- content/projects/bevy_terminal_display/sponza.png | Bin 40621 -> 0 bytes content/projects/forum/evil.png | Bin 54467 -> 0 bytes content/projects/forum/hills.png | Bin 104620 -> 0 bytes content/projects/forum/index.md | 46 ---- content/projects/forum/pyramid.png | Bin 172925 -> 0 bytes content/projects/mons/index.md | 20 -- content/projects/piss_daemon/index.md | 35 --- content/projects/piss_daemon/statusbar.png | Bin 4546 -> 0 bytes content/projects/pomd/index.md | 31 --- content/projects/pomd/statusbar.png | Bin 9883 -> 0 bytes content/snippets/_index.md | 6 - content/snippets/everforest_header.md | 34 --- content/stuff_i_like/_index.md | 137 ------------ favicon.ico | Bin 0 -> 38078 bytes index.html | 58 +++++ projects/games/NIX_AVREA/index.html | 26 +++ projects/piss_daemon/index.html | 43 ++++ projects/piss_daemon/statusbar.png | Bin 0 -> 4546 bytes public/CNAME | 1 - public/blog/blacklight_shader/blacklight.png | Bin 846587 -> 0 bytes public/blog/blacklight_shader/index.html | 227 ------------------- public/favicon.ico | Bin 38078 -> 0 bytes public/index.html | 58 ----- public/projects/games/NIX_AVREA/index.html | 26 --- public/projects/piss_daemon/index.html | 43 ---- public/projects/piss_daemon/statusbar.png | Bin 4546 -> 0 bytes public/things_i_like/music/867.png | Bin 88542 -> 0 bytes public/things_i_like/music/act_ii.jpg | Bin 33123 -> 0 bytes public/things_i_like/music/apollo.jpg | Bin 5380 -> 0 bytes public/things_i_like/music/atebts.jpg | Bin 12938 -> 0 bytes public/things_i_like/music/departure_songs.jpg | Bin 49939 -> 0 bytes public/things_i_like/music/index.html | 77 ------- public/things_i_like/music/jiminy.jpg | Bin 135977 -> 0 bytes public/things_i_like/music/lysf.jpg | Bin 86650 -> 0 bytes public/things_i_like/music/twin_fantasy.jpg | Bin 20076 -> 0 bytes public/things_i_like/music/wetdream.png | Bin 72338 -> 0 bytes things_i_like/music/867.png | Bin 0 -> 88542 bytes things_i_like/music/act_ii.jpg | Bin 0 -> 33123 bytes things_i_like/music/apollo.jpg | Bin 0 -> 5380 bytes things_i_like/music/atebts.jpg | Bin 0 -> 12938 bytes things_i_like/music/departure_songs.jpg | Bin 0 -> 49939 bytes things_i_like/music/index.html | 77 +++++++ things_i_like/music/jiminy.jpg | Bin 0 -> 135977 bytes things_i_like/music/lysf.jpg | Bin 0 -> 86650 bytes things_i_like/music/twin_fantasy.jpg | Bin 0 -> 20076 bytes things_i_like/music/wetdream.png | Bin 0 -> 72338 bytes 76 files changed, 432 insertions(+), 1245 deletions(-) delete mode 100644 .gitea/workflows/deploy.yaml delete mode 100644 .vscode/settings.json create mode 100644 CNAME create mode 100644 blog/blacklight_shader/blacklight.png create mode 100644 blog/blacklight_shader/index.html delete mode 100644 content/_index.md delete mode 100644 content/blog/_index.md delete mode 100644 content/blog/mons_i/base.png delete mode 100644 content/blog/mons_i/first_triangle.png delete mode 100644 content/blog/mons_i/index.md delete mode 100644 content/blog/mons_i/mesh.png delete mode 100644 content/blog/mons_i/mons.png delete mode 100644 content/blog/mons_i/normalmap.png delete mode 100644 content/blog/mons_i/texture.png delete mode 100644 content/blog/new-website.md delete mode 100644 content/projects/_index.md delete mode 100644 content/projects/bevy_blacklight_material/index.md delete mode 100644 content/projects/bevy_dither_post_process/index.md delete mode 100644 content/projects/bevy_dither_post_process/level_2.png delete mode 100644 content/projects/bevy_dither_post_process/level_3.png delete mode 100644 content/projects/bevy_dither_post_process/level_4.png delete mode 100644 content/projects/bevy_headless_render/index.md delete mode 100644 content/projects/bevy_outline_post_process/index.md delete mode 100644 content/projects/bevy_outline_post_process/threshold_10.png delete mode 100644 content/projects/bevy_outline_post_process/threshold_10_adaptive.png delete mode 100644 content/projects/bevy_outline_post_process/threshold_10_thick.png delete mode 100644 content/projects/bevy_outline_post_process/threshold_10_thin.png delete mode 100644 content/projects/bevy_rustysynth/index.md delete mode 100644 content/projects/bevy_terminal_display/dialog.png delete mode 100644 content/projects/bevy_terminal_display/index.md delete mode 100644 content/projects/bevy_terminal_display/sponza.png delete mode 100644 content/projects/forum/evil.png delete mode 100644 content/projects/forum/hills.png delete mode 100644 content/projects/forum/index.md delete mode 100644 content/projects/forum/pyramid.png delete mode 100644 content/projects/mons/index.md delete mode 100644 content/projects/piss_daemon/index.md delete mode 100644 content/projects/piss_daemon/statusbar.png delete mode 100644 content/projects/pomd/index.md delete mode 100644 content/projects/pomd/statusbar.png delete mode 100644 content/snippets/_index.md delete mode 100644 content/snippets/everforest_header.md delete mode 100644 content/stuff_i_like/_index.md create mode 100644 favicon.ico create mode 100644 index.html create mode 100644 projects/games/NIX_AVREA/index.html create mode 100644 projects/piss_daemon/index.html create mode 100644 projects/piss_daemon/statusbar.png delete mode 100644 public/CNAME delete mode 100644 public/blog/blacklight_shader/blacklight.png delete mode 100644 public/blog/blacklight_shader/index.html delete mode 100644 public/favicon.ico delete mode 100644 public/index.html delete mode 100644 public/projects/games/NIX_AVREA/index.html delete mode 100644 public/projects/piss_daemon/index.html delete mode 100644 public/projects/piss_daemon/statusbar.png delete mode 100644 public/things_i_like/music/867.png delete mode 100644 public/things_i_like/music/act_ii.jpg delete mode 100644 public/things_i_like/music/apollo.jpg delete mode 100644 public/things_i_like/music/atebts.jpg delete mode 100644 public/things_i_like/music/departure_songs.jpg delete mode 100644 public/things_i_like/music/index.html delete mode 100644 public/things_i_like/music/jiminy.jpg delete mode 100644 public/things_i_like/music/lysf.jpg delete mode 100644 public/things_i_like/music/twin_fantasy.jpg delete mode 100644 public/things_i_like/music/wetdream.png create mode 100644 things_i_like/music/867.png create mode 100644 things_i_like/music/act_ii.jpg create mode 100644 things_i_like/music/apollo.jpg create mode 100644 things_i_like/music/atebts.jpg create mode 100644 things_i_like/music/departure_songs.jpg create mode 100644 things_i_like/music/index.html create mode 100644 things_i_like/music/jiminy.jpg create mode 100644 things_i_like/music/lysf.jpg create mode 100644 things_i_like/music/twin_fantasy.jpg create mode 100644 things_i_like/music/wetdream.png diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml deleted file mode 100644 index 0385de5..0000000 --- a/.gitea/workflows/deploy.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Deploying Static Site -run-name: ${{ gitea.actor }} is testing out Gitea Actions πŸš€ -on: [push] - -jobs: - Build: - container: alpine:latest - steps: - - name: Install dependencies - run: apk add nodejs git openssh - - name: Check out repository code - uses: actions/checkout@v4 - - name: Write SSH keys - run: | - install -m 600 -D /dev/null ~/.ssh/id_ed25519 - echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 - ssh-keyscan -H 192.168.1.113 > ~/.ssh/known_hosts - - name: Copy built site to server - run: | - ssh git@192.168.1.113 "rm -rf /var/www/soaos.dev && mkdir /var/www/soaos.dev" - scp -sr public/. git@192.168.1.113:/var/www/soaos.dev - diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 9de7198..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "grammarly.selectors": [ - { - "language": "html", - "scheme": "file" - } - ], - "livePreview.serverRoot": "public" -} \ No newline at end of file diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..4a54f74 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +soaos.dev diff --git a/blog/blacklight_shader/blacklight.png b/blog/blacklight_shader/blacklight.png new file mode 100644 index 0000000..2c5caf1 Binary files /dev/null and b/blog/blacklight_shader/blacklight.png differ diff --git a/blog/blacklight_shader/index.html b/blog/blacklight_shader/index.html new file mode 100644 index 0000000..db4b54e --- /dev/null +++ b/blog/blacklight_shader/index.html @@ -0,0 +1,227 @@ + + + + + + + Creating a Blacklight Shader - soaos + + + + Go Home + Go Back +

Creating a Blacklight Shader

+ + NOTE: THIS POST WAS TRANSFERRED FROM MARKDOWN BY HAND SO I MIGHT HAVE MISSED SOME STUFF SORRY + +

today i wanted to take a bit of time to write about a shader i implemented for my in-progress game project (more + on that soonβ„’)

+

i wanted to create a "blacklight" effect, where specific lights could reveal part of the base texture. this + shader works with spot lights only, but could be extended to work with point lights

+
+ Example of shader running, showing hidden writing on a wall +
Example of shader running, showing hidden writing on a wall.
+
+ +

i wrote this shader in wgsl for a bevy engine project, but + it should translate easily to other shading languages

+ +

the finished shader can be found as part of this repo

+ +

shader inputs

+ +

+ for this shader, i wanted the following features: +

+ + for this to work i need the following information about each light: + + + i also need some info from the vertex shader: + +

+

bevy's default pbr vertex shader provides this information, but as long as you can get this info into your + fragment + shader you should be good to go

+ +

lastly i'll take a base color texture and a sampler

+ +

+ with all of that, i can start off the shader by setting up the inputs and fragment entry point: + +

+	#import bevy_pbr::forward_io::VertexOutput;
+
+	struct BlackLight {
+		position: vec3<f32>,
+		direction: vec3<f32>,
+		range: f32,
+		inner_angle: f32,
+		outer_angle: f32,
+	}
+
+	@group(2) @binding(0) var<storage> lights: array<BlackLight>;
+	@group(2) @binding(1) var base_texture: texture_2d<f32>;
+	@group(2) @binding(2) var base_sampler: sampler;
+
+	@fragment
+	fn fragment(
+		in: VertexOutput,
+	) -> @location(0) vec4<f32> {
+	}
+		
+ (bevy uses group 2 for custom shader bindings) +

+ +

+ since the number of lights is dynamic, i use a storage buffer to store + that information +

+ +

shader calculations

+ +

the first thing we'll need to know is how close to looking at the fragment the light source + is

+ +

+ we can get this information using some interesting math: + +

+	let light = lights[0];
+	let light_to_fragment_direction = normalize(in.world_position.xyz - light.position);
+	let light_to_fragment_angle = acos(dot(light.direction, light_to_fragment_direction));
+		
+ + the first step of this is taking the dot product of light direction and the direction from + the light to the fragment +

+ +

since both direction vectors are normalized, the dot product will be between -1.0 and 1.0

+ +

+ the dot product of two unit vectors is the cosine of the angle between them (proof + here) +

+ +

+ therefore, we take the arccosine of that dot product to get the angle between the light and + the fragment +

+ +

+ once we have this angle we can plug it in to a falloff based on the angle properties of the + light: + +

+	let angle_inner_factor = light.inner_angle/light.outer_angle;
+	let angle_factor = linear_falloff_radius(light_to_fragment_angle / light.outer_angle, angle_inner_factor);
+		
+
+	fn linear_falloff_radius(factor: f32, radius: f32) -> f32 {
+		if factor < radius { return 1.0; } else { 
+			return 1.0 - (factor - radius) / (1.0 - radius); 
+		} 
+	}
+		
+

+

+ next, we need to make sure the effect falls off properly over distance we can do this by getting the distance + from the light to + the fragment and normalizing it with the range of the light before plugging that into an inverse square falloff + we'll use squared distance to avoid expensive and unnecessary square root operations: +

+	let light_distance_squared=distance_squared(in.world_position.xyz, light.position);
+	let distance_factor=inverse_falloff_radius(saturate(light_distance_squared / (light.range * light.range)), 0.5);
+		
+
+	fn distance_squared(a: vec3f, b: vec3f) -> f32 {
+		let vec = a - b;
+		return dot(vec, vec);
+	}
+
+	fn inverse_falloff(factor: f32) -> f32 {
+		return pow(1.0 - factor, 2.0);
+	}
+
+	fn inverse_falloff_radius(factor: f32, radius: f32) -> f32 {
+		if factor < radius { return 1.0; } else { 
+			return inverse_falloff((factor - radius) / (1.0 - radius)); 
+		}
+	}
+		
+

+

+ now we'll have a float multiplier between 0.0 and 1.0 for our angle and distance to the light we can get the + resulting color by multiplying these with the base color texture: +

+	let base_color = textureSample(base_texture, base_sampler, in.uv);
+	let final_color=base_color * angle_factor * distance_factor;
+		
+ this works for one light, but we need to refactor it to loop over all the provided blacklights: +
+
+	@fragment fn fragment( in: VertexOutput ) -> @location(0) vec4<f32> {
+		let base_color = textureSample(base_texture, base_sampler, in.uv);
+		var final_color = vec4f(0.0, 0.0, 0.0, 0.0);
+		for (var i = u32(0); i < arrayLength(&lights); i = i+1) { 
+			let light=lights[i];
+			let light_to_fragment_direction = normalize(in.world_position.xyz - light.position);
+			let light_to_fragment_angle = acos(dot(light.direction, light_to_fragment_direction));
+			let angle_inner_factor = light.inner_angle / light.outer_angle;
+			let angle_factor = linear_falloff_radius(light_to_fragment_angle / light.outer_angle, angle_inner_factor);
+			let light_distance_squared = distance_squared(in.world_position.xyz, light.position);
+			let distance_factor = inverse_falloff_radius(saturate(light_distance_squared / (light.range * light.range)), 0.5);
+			final_color = saturate(final_color + base_color * angle_factor * distance_factor);
+		} 
+		return final_color; 
+	}
+		
+ and with that, the shader is pretty much complete you can view the full completed shader code here +

+

have fun!

+ + + \ No newline at end of file diff --git a/content/_index.md b/content/_index.md deleted file mode 100644 index 3929896..0000000 --- a/content/_index.md +++ /dev/null @@ -1,20 +0,0 @@ -+++ -template = "index.html" -title = "hello" -+++ - -# soaos - silas bartha - -- [projects](@/projects/_index.md) -- [blog](@/blog/_index.md) -- [snippets](@/snippets/_index.md) -- [some stuff i like](@/stuff_i_like/_index.md) -- [git](https://git.soaos.dev/soaos) -- [forum](https://forum.soaos.dev) - -find me in other places - -- mail: silas@soaos.dev -- github: @soaosdev -- youtube: [@soaosdev](https://youtube.com/@soaosdev) -- mastodon: soaos@furry.engineer diff --git a/content/blog/_index.md b/content/blog/_index.md deleted file mode 100644 index 818c73c..0000000 --- a/content/blog/_index.md +++ /dev/null @@ -1,6 +0,0 @@ -+++ -title = "blog" -sort_by = "date" -template = "blog.html" -page_template = "blog-page.html" -+++ diff --git a/content/blog/mons_i/base.png b/content/blog/mons_i/base.png deleted file mode 100644 index 60a4d0f..0000000 Binary files a/content/blog/mons_i/base.png and /dev/null differ diff --git a/content/blog/mons_i/first_triangle.png b/content/blog/mons_i/first_triangle.png deleted file mode 100644 index 16d0992..0000000 Binary files a/content/blog/mons_i/first_triangle.png and /dev/null differ diff --git a/content/blog/mons_i/index.md b/content/blog/mons_i/index.md deleted file mode 100644 index 9b22d2f..0000000 --- a/content/blog/mons_i/index.md +++ /dev/null @@ -1,249 +0,0 @@ -+++ -title = "mons (the mountain) - part i: i got sidetracked writing c for a week" -date = 2025-02-06 -[extra] -coverimage = "./mons.png" -+++ - -## the valley - -so i've been working for a while on a large game project and was really starting to get burnt out - -it's been my primary focus since graduating from school and progress started slowing to a crawl - -it was clear to me that i needed a break from the project to recharge a little bit - -so i decided to try and start a project i've been fantasizing about for a long time: - -![MONS](./mons.png) - -mons is a monumental undertaking, an excercise in insanity, and my personal code sanctuary - -the goal of the project is pretty abstract, i'm just coding whatever i feel like, but doing it with - -## a couple rules - -### rule 1: c99 - -no rust :( - -i've been writing rust almost every day for the last 3 years, it's time to get scary - -c is like dead simple which is why i think it will be a pretty meditative experience - -by meditative i mean mind-numbingly tedious but i'm not in a rush here - -i think the absolute worst part of this is the lack of namespaces but i'll live - -### rule 2: extremely limited dependencies - -it's time to get real - -if i'm undertaking this journey in ~~masochism~~ voluntary discomfort (only true stoic sigmas get this one) i might as well be learning something while i do it - -this would be "no dependencies" but like i kind of want to make some fun stuff at some point - -so i have 3 big exceptions - -i can use stdlib and posix shit (at my discretion) - -i can use "important" libraries - -i don't really have a good description for what makes a library "important" but think hardware stuff like opengl/vulkan or xlib - -the last thing is that i can use freely available implementations of algorithms i have no chance in hell of understanding, like [mikktspace](http://www.mikktspace.com/) - -i just don't see much value in doing that myself - -## the foot - -### mons_math - -starting out from nothing i decided my first goal would be to spin up a basic 3d graphical application - -i decided to start with opengl, i have experience with both it and vulkan and opengl is significantly less work to get started with - -before i could even render a basic triangle though, i needed (wanted) a way to represent and manipulate basic linear algebra types such as vectors, matrices, and quaternions - -so on the first day i just sat on my couch and typed up a library for exactly that - -``` -mons_math/src/ -β”œβ”€β”€ mat2.c -β”œβ”€β”€ mat3.c -β”œβ”€β”€ mat4.c -β”œβ”€β”€ quat.c -β”œβ”€β”€ util.c -β”œβ”€β”€ vec2.c -β”œβ”€β”€ vec3.c -└── vec4.c -``` -(i won't get into implementation details too much in this post in the interest of brevity, but all the code is available on my [git server](https://git.soaos.dev/mons/)) - -i found writing the matrix and vector operations super satisfying in spite of the repetition for different dimensionalities - -i do wish i had kept in mind that opengl is column-major for matrices, since i wrote mine as row-major like a normal person, but it might honestly be for the best, as it makes using them much more intuitive based on the stuff i learned in math class - -once i had this library i was quickly able to spin up a basic 3d app using opengl, along with xlib and glx for windowing and input under x11 - -![first triangle](./first_triangle.png) - -i had always used [glfw](https://www.glfw.org/) for windowing so it was interesting to see how similar it was using xlib (although there were some tricky differences, like windows being created without a depth buffer by default) - -### auto-embedding shader files - -i set up my project to automatically embed shaders in my code which was pretty cool - -basically there isn't a c mechanism similar to rust's lovely [`include_bytes`](https://doc.rust-lang.org/std/macro.include_bytes.html) macro, so the best you can really do is generate a constant byte array and store it in a header file - -luckily i learned how to use the [xxd](https://linux.die.net/man/1/xxd) tool to automatically generate such a header file, and then added a script to automatically embed all files located in my project's `embed` folder and place generated headers in the corresponding `include/embedded` location - -``` -embed/ -└── shaders - β”œβ”€β”€ basic.frag.glsl - └── basic.vert.glsl -include/ -β”œβ”€β”€ ... -β”œβ”€β”€ embedded -β”‚Β Β  └── shaders -β”‚Β Β  β”œβ”€β”€ basic.frag.glsl.h -β”‚Β Β  └── basic.vert.glsl.h -└── ... -``` - -then i added it as a fake target in my cmake project and made the main project target depend on it - -### mons_qoi - -not satisfied with a simple solid color, i decided i needed to load images - -obviously i wasn't allowed to use an existing loader like [stbi](https://github.com/nothings/stb/blob/master/stb_image.h) - -i did take a quick look at the png and jpeg specifications since these are by far and away the most popular texture image formats out there - -my lazy ass was not about to write a loader for either of those formats (for now) - -for now i decided to look for something easy to implement but like actually respectable (so not [ppm](https://netpbm.sourceforge.net/doc/ppm.html)), and boy oh boy - -enter [qoi](https://qoiformat.org/) - -this shit descended from the heavens i swear to god - -qoi, or the quite ok image format, is extremely simple and extremely fast to encode and decode, and offers pretty decent lossless compression - -my decoder is around 200 lines of c i think, which is a bit more than the [reference implementation](https://github.com/phoboslab/qoi) i believe but i tried my best to not refer to it for fun - -once i had that i was able to just pop the loaded image data into opengl textures - -![loaded texture](./texture.png) - -### mons_json - -up to this point i was using hardcoded vertex buffers and i wanted to be able to load more complex geometry - -i considered using [obj](https://www.loc.gov/preservation/digital/formats/fdd/fdd000507.shtml) for my models but i'm a big fan of [gltf](https://www.khronos.org/Gltf) so i decided to just jump the gun and go for a gltf loader right off the bat - -gltf is stored as [json](https://www.json.org/json-en.html) data so i knew if i wanted to have a shot i would need a flexible, dynamic json solution - -```c -struct mons_json_value; -union mons_json_entry; - -typedef struct mons_json_array { - struct mons_json_value *values; - unsigned int len; -} mons_json_array; - -typedef union mons_json_value_data { - char *string; - float number; - mons_hashmap object; - mons_json_array array; - bool boolean; - void *null; -} mons_json_value_data; - -typedef enum mons_json_value_type { - MONS_JSON_STRING, - MONS_JSON_NUMBER, - MONS_JSON_OBJECT, - MONS_JSON_ARRAY, - MONS_JSON_BOOL, - MONS_JSON_NULL, -} mons_json_value_type; - -typedef struct mons_json_value { - mons_json_value_type type; - mons_json_value_data data; -} mons_json_value; -``` - -i discovered a cool pattern here where a combination of an enum and a union (never actually used one before this project) allowed me to store a variety of types in a `mons_json_value` while being aware of which type it actually was - -### mons_hashmap - -the performance of my json structures depended on my ability to store key-value pairs in an efficient-to-access way - -obvious choice was a hashmap data structure - -i just implemented this from memory from my data structures class back in school - -```c -typedef struct mons_hashmap_pair { - char *key; - void *value; - struct mons_hashmap_pair *next; -} mons_hashmap_pair; - -typedef struct mons_hashmap { - mons_hashmap_pair **data; - unsigned int bucket_count; - unsigned int member_size; - unsigned int len; -} mons_hashmap; -``` - -this hashmap is basically just an array of linked lists that pairs get shoved into based on the hash of the key - -for the hash function i just went with the [djb2 hash function](http://www.cse.yorku.ca/~oz/hash.html) since it worked well for me in the past - -### mons_gltf - -at long last, i was able to dig into the gltf format - -[the specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html) is quite deep and i focused on implementing basic mesh features first, opting to do things like animations, morph targets, scenes, node hierarchies, etc. later - -i actually found the process of implementing the loader pretty chill, i especially enjoyed learning how the data was stored in the binary buffers and how to use accessors to read it - -after about a day of work i managed to get mesh primitives out of the gltf files and into my in-memory model structure - -![mesh loaded](./mesh.png) - -(i was using [this model](https://polyhaven.com/a/marble_bust_01) for testing) - -the textures that came with the model were in jpeg format, which i obviously could not yet load, and the gltf spec doesn't support formats other than jpeg and png - -so i said "To hell with the spec!" and switched the image mimetypes to the (illegal) `image/qoi` and converted the textures using [imagemagick](https://imagemagick.org/index.php) anyway - -then my textures loaded beautifully - -![base color texture applied to mesh](./base.png) - -at this point i was getting pretty tired lol - -i was ready to take a break from my break - -but i wanted to leave off in a really satisfying place so i decided to implement normal mapping as one last thing - -as i previously mentioned i would use the [mikktspace](http://www.mikktspace.com) algorithm to do my tangent calculations - -![normal mapping](./normalmap.png) - -and with that i decided i was ready to go back and get some work done on something actually important to me - -this whole process took me about a week and was a pretty chill experience - -thanks for reading this far, i hope it's not too brutal - -\- silas diff --git a/content/blog/mons_i/mesh.png b/content/blog/mons_i/mesh.png deleted file mode 100644 index aedf3a1..0000000 Binary files a/content/blog/mons_i/mesh.png and /dev/null differ diff --git a/content/blog/mons_i/mons.png b/content/blog/mons_i/mons.png deleted file mode 100644 index 6aeb835..0000000 Binary files a/content/blog/mons_i/mons.png and /dev/null differ diff --git a/content/blog/mons_i/normalmap.png b/content/blog/mons_i/normalmap.png deleted file mode 100644 index c295595..0000000 Binary files a/content/blog/mons_i/normalmap.png and /dev/null differ diff --git a/content/blog/mons_i/texture.png b/content/blog/mons_i/texture.png deleted file mode 100644 index 94e071c..0000000 Binary files a/content/blog/mons_i/texture.png and /dev/null differ diff --git a/content/blog/new-website.md b/content/blog/new-website.md deleted file mode 100644 index 4c92481..0000000 --- a/content/blog/new-website.md +++ /dev/null @@ -1,67 +0,0 @@ -+++ -title = "time for a new website" -date = 2024-08-13 -+++ -dear witness, - -this is the first post on my new website, which i'm creating using the [zola](https://www.getzola.org) static site generator - -the old site used [jekyll](jekyllrb.com), which i like a lot, and i've used it for over 5 years - -
- -i always found the ruby development environment to be a massive pain in the ass to set up, which is why zola was pretty appealing - -i also never use ruby for damn near anything, so i never keep it installed - -i've also just been meaning to change things up a little in general - -the whole early web 2.0 aesthetic is a lot of fun, but i've been feeling a bit more drawn towards minimalism lately - -besides, i was barely even sentient when that aesthetic was big - -
- -i might port over the old posts - -might not - -some of that stuff was pretty cool - -you can always check out the internet archive to see that stuff if you want: [http://web.archive.org/web/20240226014714/https://exvacuum.dev/notes](http://web.archive.org/web/20240226014714/https://exvacuum.dev/notes) - -
- -idk why i decided to write like this but it's kind of funny - -a bit rambly - -it's actually really annoying trying to intentionally write poorly - -
- -i do want to start writing more of these things because god i feel like i learn so much and don't have anywhere to share it - -like i have my [youtube channel](https://youtube.com/@silasbartha), which is great when i can muster up the willpower to throw something together, but i don't feel like my skills are developed enough to output videos at a rate or quality which would satisfy me - -i would be spending more time on videos about my projects than the projects themselves - -
- -i'm actually putting off my big personal project right now to do this lol - -but it's important (i think) - -my site's on my resume and i'm looking for jobs right now - -if you're a potential employer reading this, first of all: i'm surprised you read this far! - -but also please hire me or something - -not for frontend web development obviously - -
- -thanks for reading this, - -\- silas diff --git a/content/projects/_index.md b/content/projects/_index.md deleted file mode 100644 index 8448ec5..0000000 --- a/content/projects/_index.md +++ /dev/null @@ -1,5 +0,0 @@ -+++ -title = "projects" -template = "projects.html" -page_template = "project-page.html" -+++ diff --git a/content/projects/bevy_blacklight_material/index.md b/content/projects/bevy_blacklight_material/index.md deleted file mode 100644 index fb6b0c0..0000000 --- a/content/projects/bevy_blacklight_material/index.md +++ /dev/null @@ -1,16 +0,0 @@ -+++ -title = "bevy_blacklight_material" -[taxonomies] -categories = ["bevy plugin"] -languages = ["rust", "wgsl"] -[extra] -github = ["soaos/bevy_blacklight_material"] -crates = ["bevy_blacklight_material"] -git = ["bevy_blacklight_material"] -+++ - -this plugin for the [bevy](https://bevyengine.org) engine provides a "blacklight" material which is visible based on the properties of specially-marked spotlights. - -i wrote this one day, i kind of forget why. - -probably for a puzzle in my upcoming game project. diff --git a/content/projects/bevy_dither_post_process/index.md b/content/projects/bevy_dither_post_process/index.md deleted file mode 100644 index 1357766..0000000 --- a/content/projects/bevy_dither_post_process/index.md +++ /dev/null @@ -1,29 +0,0 @@ -+++ -title = "bevy_dither_post_process" -[taxonomies] -categories = ["bevy plugin"] -languages = ["rust", "wgsl"] -[extra] -github = ["soaosdev/bevy_dither_post_process"] -crates = ["bevy_dither_post_process"] -+++ - -this plugin allows you to add a "monochromatic ordered dithering" post-processing effect to cameras in your bevy engine application - -![level 3](level_3.png) - -the dithering is monochromatic (black & white) and ordered (using the bayer method) (i'm gonna write a blog post about this soon) - -it can be configured with the "level" of dithering to perform (i.e. the size of the bayer matrix to use, where level *n* results in a matrix of size *2^(n+1)*) - -![level 2](level_2.png) -![level 4](level_4.png) - -i wrote this plugin to enhance the performance of my ongoing game project - -originally i did all the dithering on the CPU, and while it was not a huge performance drain due to the screen size being relatively small in the terminal, i figured it would be a good idea to convert it into a shader to take advantage of the GPU and parallelism - -since i was using ordered dithering anyways it was pretty easy to port over, since that kind of dithering is super parallelizable on account of not needing to know anything about any other fragment on the screen unlike some methods that provide superior visual quality - -the reason i chose ordered dithering though was that other methods produced too much "jitter" when applied to moving objects which was pretty disorienting - diff --git a/content/projects/bevy_dither_post_process/level_2.png b/content/projects/bevy_dither_post_process/level_2.png deleted file mode 100644 index a6104ff..0000000 Binary files a/content/projects/bevy_dither_post_process/level_2.png and /dev/null differ diff --git a/content/projects/bevy_dither_post_process/level_3.png b/content/projects/bevy_dither_post_process/level_3.png deleted file mode 100644 index 28cb461..0000000 Binary files a/content/projects/bevy_dither_post_process/level_3.png and /dev/null differ diff --git a/content/projects/bevy_dither_post_process/level_4.png b/content/projects/bevy_dither_post_process/level_4.png deleted file mode 100644 index acc4d2c..0000000 Binary files a/content/projects/bevy_dither_post_process/level_4.png and /dev/null differ diff --git a/content/projects/bevy_headless_render/index.md b/content/projects/bevy_headless_render/index.md deleted file mode 100644 index 3113ef9..0000000 --- a/content/projects/bevy_headless_render/index.md +++ /dev/null @@ -1,13 +0,0 @@ -+++ -title = "bevy_headless_render" -[taxonomies] -categories = ["bevy plugin"] -languages = ["rust"] -[extra] -github = ["soaosdev/bevy_headless_render"] -crates = ["bevy_headless_render"] -+++ - -this plugin is pretty simple, it just allows you to set up a render texture to be extracted for use on the CPU every frame - -i made this plugin as part of a game project super early on when i needed a copy of the rendered frame in the main world to be rendered as braille to the screen diff --git a/content/projects/bevy_outline_post_process/index.md b/content/projects/bevy_outline_post_process/index.md deleted file mode 100644 index 3c828e6..0000000 --- a/content/projects/bevy_outline_post_process/index.md +++ /dev/null @@ -1,28 +0,0 @@ -+++ -title = "bevy_outline_post_process" -[taxonomies] -categories = ["bevy plugin"] -languages = ["rust", "wgsl"] -[extra] -github = ["soaosdev/bevy_outline_post_process"] -crates = ["bevy_outline_post_process"] -+++ - -this plugin allows you to add outlines to a camera as a post-processing effect in the bevy engine - -![0.1 threshold, 2.0 thickness](threshold_10.png) - -the effect makes use of a normal prepass to determine surface normals of objects in view, and then uses the differences between those normal values to determine where outlines should occur - -the effect is configurable, you can change the thickness of the outlines and the threshold (how significant the difference between normals need to be for an outline to appear) - -![0.1 threshold, 1.0 thickness](threshold_10_thin.png) -![0.1 threshold, 4.0 thickness](threshold_10_thick.png) - -there's also an option to enable *adaptive outlines*, so that darker areas get outlined with white and brighter areas are outlined with black - -![adaptive](threshold_10_adaptive.png) - -i created this effect to improve visual contrast in my game project, which is why i haven't added support for different colors - -you're free to add it yourself though, probably wouldn't be too hard diff --git a/content/projects/bevy_outline_post_process/threshold_10.png b/content/projects/bevy_outline_post_process/threshold_10.png deleted file mode 100644 index 4490bd5..0000000 Binary files a/content/projects/bevy_outline_post_process/threshold_10.png and /dev/null differ diff --git a/content/projects/bevy_outline_post_process/threshold_10_adaptive.png b/content/projects/bevy_outline_post_process/threshold_10_adaptive.png deleted file mode 100644 index 6ad93d9..0000000 Binary files a/content/projects/bevy_outline_post_process/threshold_10_adaptive.png and /dev/null differ diff --git a/content/projects/bevy_outline_post_process/threshold_10_thick.png b/content/projects/bevy_outline_post_process/threshold_10_thick.png deleted file mode 100644 index 85eaaf0..0000000 Binary files a/content/projects/bevy_outline_post_process/threshold_10_thick.png and /dev/null differ diff --git a/content/projects/bevy_outline_post_process/threshold_10_thin.png b/content/projects/bevy_outline_post_process/threshold_10_thin.png deleted file mode 100644 index fbb867e..0000000 Binary files a/content/projects/bevy_outline_post_process/threshold_10_thin.png and /dev/null differ diff --git a/content/projects/bevy_rustysynth/index.md b/content/projects/bevy_rustysynth/index.md deleted file mode 100644 index 12ae97e..0000000 --- a/content/projects/bevy_rustysynth/index.md +++ /dev/null @@ -1,12 +0,0 @@ -+++ -title = "bevy_rustysynth" -draft = true -[taxonomies] -categories = ["bevy plugin"] -languages = ["rust", "wgsl"] -[extra] -github = ["soaosdev/bevy_rustysynth"] -crates = ["bevy_rustysynth"] -git = ["bevy_rustysynth"] -+++ - diff --git a/content/projects/bevy_terminal_display/dialog.png b/content/projects/bevy_terminal_display/dialog.png deleted file mode 100644 index d9281f2..0000000 Binary files a/content/projects/bevy_terminal_display/dialog.png and /dev/null differ diff --git a/content/projects/bevy_terminal_display/index.md b/content/projects/bevy_terminal_display/index.md deleted file mode 100644 index 2aab246..0000000 --- a/content/projects/bevy_terminal_display/index.md +++ /dev/null @@ -1,28 +0,0 @@ -+++ -title = "bevy_terminal_display" -[taxonomies] -categories = ["bevy plugin"] -languages = ["rust"] -[extra] -very_cool = true -github = ["soaosdev/bevy_terminal_display"] -crates = ["bevy_terminal_display"] -+++ - -this plugin allows you to render from a camera to the terminal using [unicode braille characters](https://en.wikipedia.org/wiki/Braille_Patterns) - -![sponza](sponza.png) - -it makes use of the [bevy_headless_render](@/projects/bevy_headless_render/index.md) plugin for headless rendering, and then uses the [bevy_dither_post_process](@/projects/bevy_dither_post_process/index.md) plugin to dither the captured frame before converting the black and white pixels into the appropriate characters and printing them to the terminal - -this plugin uses the [ratatui](https://crates.io/crates/ratatui) and [crossterm](https://crates.io/crates/crossterm) for rendering to the terminal - -this plugin manages a `TerminalInput` resource which keeps track of pressed keys - -this plugin also has facilities for creating and rendering ratatui widgets - -here's an example of a dialog box and option selection widget i've implemented in one of my WIP projects - -![dialog widget](dialog.png) - -in that project, i also make use of the [bevy_outline_post_process](@/projects/bevy_outline_post_process/index.md) for additional visual contrast diff --git a/content/projects/bevy_terminal_display/sponza.png b/content/projects/bevy_terminal_display/sponza.png deleted file mode 100644 index 6568cf3..0000000 Binary files a/content/projects/bevy_terminal_display/sponza.png and /dev/null differ diff --git a/content/projects/forum/evil.png b/content/projects/forum/evil.png deleted file mode 100644 index 14047b0..0000000 Binary files a/content/projects/forum/evil.png and /dev/null differ diff --git a/content/projects/forum/hills.png b/content/projects/forum/hills.png deleted file mode 100644 index c0c0e89..0000000 Binary files a/content/projects/forum/hills.png and /dev/null differ diff --git a/content/projects/forum/index.md b/content/projects/forum/index.md deleted file mode 100644 index caa6288..0000000 --- a/content/projects/forum/index.md +++ /dev/null @@ -1,46 +0,0 @@ -+++ -title = "forum" -[taxonomies] -categories = ["game"] -languages = ["jsx", "sass", "python"] -[extra] -wip = true -git = ["forum"] -+++ - -this is a little CRUD project i wrote when trying to refresh my full stack skills - -i used react and three.js (via [react three fiber](https://r3f.docs.pmnd.rs/getting-started/introduction)) for the frontend and flask for the backend - -i was originally using mongodb for the database but ran into issues with it being unsupported on the raspberry pi 4's architecture so i had to rewrite the backend to use sqlite instead - -you can play it in your browser (on desktop): [https://forum.soaos.dev](https://forum.soaos.dev) - -it's a game where you can walk around a 3D environment and place text notes around for others to read - -you can edit and remove notes that you wrote as well - -![image of the forum's rolling hills](./hills.png) - -i was inspired by this one minigame from [the beginner's guide](https://en.wikipedia.org/wiki/The_Beginner%27s_Guide) where you walk around and read notes that were supposedly left by other users - -there was some point in the game about it really just being one guy talking to himself or something but i just thought it would be a really cool thing if it was real - -![image of looming pyramid](./pyramid.png) - -my friends had a lot of fun defacing the place - -some people got a bit clever and started making manual api requests to put messages in impossible places - -![image of unspeakable evil](./evil.png) - -i had to implement server-side validation of message positions which was less of a pain in the ass than i had hoped - -i went the naive route of just loading the terrain model into the backend and using the open3d library to do a distance check - -there's still a fair amount of polish to put on this project but people seemed to enjoy it a lot - -it would be cool if someone stumbled on this project a long time from now and saw what people were writing - -i know i would be fascinated - diff --git a/content/projects/forum/pyramid.png b/content/projects/forum/pyramid.png deleted file mode 100644 index 5b7bfd7..0000000 Binary files a/content/projects/forum/pyramid.png and /dev/null differ diff --git a/content/projects/mons/index.md b/content/projects/mons/index.md deleted file mode 100644 index 2a57777..0000000 --- a/content/projects/mons/index.md +++ /dev/null @@ -1,20 +0,0 @@ -+++ -title = "mons" -[taxonomies] -categories = ["misc"] -languages = ["c"] -[extra] -wip = true -git = ["mons"] -+++ - -mons is a big repo of c stuff i'm writing "from scratch" - -it's an ever-expanding collection of filth, including: - -- linear algebra -- data structures -- a json de/serializer -- a qoi image decoder -- a (non-compliant) gltf parser -- an opengl-based 3d graphics library diff --git a/content/projects/piss_daemon/index.md b/content/projects/piss_daemon/index.md deleted file mode 100644 index c409332..0000000 --- a/content/projects/piss_daemon/index.md +++ /dev/null @@ -1,35 +0,0 @@ -+++ -title = "piss daemon" -[taxonomies] -categories = ["utility"] -languages = ["rust"] -[extra] -finished = "december 2024" -git = ["piss-daemon"] -+++ -this is a dbus daemon (`pissd`) and client (`piss-level`) that monitor the international space station's urine tank level - -i have it integrated into my status bar (X version): - -![](./statusbar.png) - -```bash -#... - -function piss { - PISS_LEVEL="$(piss-level)"; - if [ -n "$PISS_LEVEL" ]; then - echo " ξ½― ${PISS_LEVEL}%"; - fi; -} - -#... - -while true; do - xsetroot -name "$(piss)$(batt)$(datetime)"; - sleep 1; -done; -``` - -i made this pretty much entirely so that i could call a program "piss daemon" - diff --git a/content/projects/piss_daemon/statusbar.png b/content/projects/piss_daemon/statusbar.png deleted file mode 100644 index b98e021..0000000 Binary files a/content/projects/piss_daemon/statusbar.png and /dev/null differ diff --git a/content/projects/pomd/index.md b/content/projects/pomd/index.md deleted file mode 100644 index 93bc734..0000000 --- a/content/projects/pomd/index.md +++ /dev/null @@ -1,31 +0,0 @@ -+++ -title = "pomd" -description = "pomodoro timer daemon" -[taxonomies] -categories = ["utility"] -languages = ["rust"] -[extra] -finished = "november 2023" -github = ["soaosdev/pomd", "soaosdev/pomc"] -crates = ["pomd", "pomc"] -+++ - -this was a pretty simple rust project i did over the course of a couple days - -i had been wanting to experiment with d-bus on linux for a while and figured that writing a pomodoro daemon and client would be a good way to understand the basics of how d-bus interfaces work - -luckily i found the wonderful [zbus](https://crates.io/crates/zbus) crate which made everything for hooking up interface super simple - -i think the hardest thing about this project was trying to figure out how to accurately keep the time left in the timer - -as with many problems in rust the solution ended up being to find a [crate](https://crates.io/crates/pausable_clock) that implemented a "pausable clock" that worked similarly to a normal rust `std::time::Instant` - -it's pretty configurable from what i remember - -i used this program when i was using [dwm](https://dwm.suckless.org) and wanted a daemon to integrate into my statusbar - -![pomd segment in my dwm statusbar](statusbar.png) - -now i use KDE plasma which has a pretty good pomodoro applet available, maybe in the future i could make some kind of widget that communicates with the daemon - - diff --git a/content/projects/pomd/statusbar.png b/content/projects/pomd/statusbar.png deleted file mode 100644 index 6ca820a..0000000 Binary files a/content/projects/pomd/statusbar.png and /dev/null differ diff --git a/content/snippets/_index.md b/content/snippets/_index.md deleted file mode 100644 index 36321c9..0000000 --- a/content/snippets/_index.md +++ /dev/null @@ -1,6 +0,0 @@ -+++ -title = "snippets" -sort_by = "date" -template = "snippets.html" -page_template = "snippet-page.html" -+++ diff --git a/content/snippets/everforest_header.md b/content/snippets/everforest_header.md deleted file mode 100644 index 88ea56b..0000000 --- a/content/snippets/everforest_header.md +++ /dev/null @@ -1,34 +0,0 @@ -+++ -title = "everforest.h" -date = 2024-08-13 -+++ - -```c -#ifndef EVERFOREST_H -#define EVERFOREST_H - -#define EVERFOREST_FG 0xD3C6AAFF -#define EVERFOREST_BG0 0x2D353CFF -#define EVERFOREST_BG1 0x343F44FF -#define EVERFOREST_BG2 0x3D484DFF -#define EVERFOREST_BG3 0x475258FF -#define EVERFOREST_BG4 0x4F585EFF -#define EVERFOREST_BG5 0x56635FFF - -#define EVERFOREST_BG_DIM 0x232A2EFF -#define EVERFOREST_BG_RED 0x543A48FF -#define EVERFOREST_BG_VISUAL 0x514045FF -#define EVERFOREST_BG_YELLOW 0x4D4C43FF -#define EVERFOREST_BG_GREEN 0x425047FF -#define EVERFOREST_BG_BLUE 0x3A515DFF - -#define EVERFOREST_RED 0xE76E80FF -#define EVERFOREST_ORANGE 0xE69875FF -#define EVERFOREST_YELLOW 0xDBBC7FFF -#define EVERFOREST_GREEN 0xA7C080FF -#define EVERFOREST_BLUE 0x7FBBB3FF -#define EVERFOREST_AQUA 0x83C092FF -#define EVERFOREST_PURPLE 0xD699B6FF - -#endif -``` diff --git a/content/stuff_i_like/_index.md b/content/stuff_i_like/_index.md deleted file mode 100644 index 5a42254..0000000 --- a/content/stuff_i_like/_index.md +++ /dev/null @@ -1,137 +0,0 @@ -+++ -template = "base.html" -title = "some stuff i like" -+++ - -# some stuff i like - -this is a page for stuff i like - -## music - -here's a few albums i like - -i'm putting stuff i've been listening to recently closer to the top - -please email me recommendations lol ([silas@soaos.dev](mailto:silas@soaos.dev)) - ---- -{{ coverimage(url="./trauma.jpg") }} -**iii: trauma** -
-*harakiri for the sky* -
-listen/download from [bandcamp](https://artofpropaganda.bandcamp.com/album/iii-trauma) -> i wish i had heard this album sooner - -> i think it would have helped me a lot when i needed it ---- -{{ coverimage(url="./867.png") }} -**867** -
-[*this is the glasshouse*](https://waved.carrd.co/) -
-listen/download from [bandcamp](https://thisistheglasshouse.bandcamp.com/album/867) -> i found this album a few weeks ago and haven't been able to stop playing it - -> exceedingly common canadian w ---- -{{ coverimage(url="./repetitions.jpg") }} -**repetitions** -
-[*blueneck*](https://blueneck.co.uk) -
-listen/download from [bandcamp](https://blueneckuk.bandcamp.com/album/repetitions) -> maybe the british are alright ---- -{{ coverimage(url="./wetdream.png") }} -**wetdream** -
-[*willy rodriguez*](https://willyrodriguez.bandcamp.com/music) -
-listen/download from [bandcamp](https://willyrodriguez.bandcamp.com/album/wetdream) -> this band broke up after releasing this album but holy banger - -> this might have been my favorite album of 2023 in retrospect ---- -{{ coverimage(url="./departure_songs.jpg") }} -**departure songs** -
-[*we lost the sea*](https://www.welostthesea.com/) -
-listen/download from [bandcamp](https://welostthesea.bandcamp.com/album/departure-songs) -> an utterly gut-wrenching listen - -> kind of like if requiem for a dream was an album ---- -{{ coverimage(url="./atebts.jpg") }} -**above the earth, below the sky** -
-[*if these trees could talk*](https://www.metalblade.com/us/artists/if-these-trees-could-talk/) -
-listen/download from [bandcamp](https://ifthesetreescouldtalk.bandcamp.com/album/above-the-earth-below-the-sky) -> just seriously cool heavy post-rock - ---- -{{ coverimage(url="./jiminy.jpg") }} -**jiminy** -
-[*bear ghost*](https://www.bearghost.com/) -
-listen/download from [bandcamp](https://bearghost.bandcamp.com/album/jiminy-2) -> jiminy... - -> another insane album from 2023 - -> scooby doo ahh music ---- -{{ coverimage(url="./act_ii.jpg") }} -**act ii: the meaning of, and all things regarding ms. leading** -
-[*the dear hunter*](https://caveandcanary.bandcamp.com/music) -
-listen on [youtube](https://www.youtube.com/watch?v=F2-kOgabt6M&list=PL5B95136021242104) -> i really love all of the dear hunter's music, all the acts are great but act ii is probably my favorite overall - -> this and all the "acts" albums are super theatrical ---- -{{ coverimage(url="./apollo.jpg") }} -**good apollo i'm burning star iv volume one: from fear through the eyes of madness** -
-[*coheed and cambria*](https://coheedandcambria.com/) -
-listen/download from [internet archive](https://archive.org/details/13-the-willing-well-ii-from-fear-through-the-eyes-of-madness) -> i don't have much to say about this - -> ( ._.) - it's peak ---- -{{ coverimage(url="./twin_fantasy.jpg") }} -**twin fantasy** -
-[*car seat headrest*](https://carseatheadrest.com/) -
-listen/download from [bandcamp](https://carseatheadrest.bandcamp.com/album/twin-fantasy) - ---- -{{ coverimage(url="./lysf.jpg") }} -**lift your skinny fists like antennas to heaven** -
-[*godspeed you! black emperor*](https://cstrecords.com/pages/godspeed-you-black-emperor) -
-listen/download from [bandcamp](https://godspeedyoublackemperor.bandcamp.com/album/lift-your-skinny-fists-like-antennas-to-heaven) - ---- -{{ coverimage(url="./the_black_parade.jpg") }} -**the black parade** -
-[*my chemical romance*](https://www.mychemicalromance.com) - ---- -{{ coverimage(url="./i_like_fun.jpg") }} -**i like fun** -
-[*they might be giants*](https://www.theymightbegiants.com/) -
-listen/download on [bandcamp](https://tmbg.bandcamp.com/album/i-like-fun) -> might unironically be my favorite tmbg album ---- diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..eed9644 Binary files /dev/null and b/favicon.ico differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..725c752 --- /dev/null +++ b/index.html @@ -0,0 +1,58 @@ + + + + + + + soaos + + + +

soaos

+ +

Hey, welcome to my site, or what's left of it, LMAO.

+ +

About

+

+ I'm Silas Bartha, an "artist" and professional software developer. + I do full stack for my work and in my free time I mostly work on eccentric software projects which you can read + about here (soon). +

+ +

+ Recently I've been trying to branch out a bit. + I have a few skills I'd like to pick up over the course of the next few years, + which will help me better execute future projects. + It's hard because I hate being awful at things haha. +

+ +

Stuff on this Server (Under Construction)

+ + +

See me

+ + +

Webrings

+ + EVILRING + + + + \ No newline at end of file diff --git a/projects/games/NIX_AVREA/index.html b/projects/games/NIX_AVREA/index.html new file mode 100644 index 0000000..47c914b --- /dev/null +++ b/projects/games/NIX_AVREA/index.html @@ -0,0 +1,26 @@ + + + + + + + NIX AVREA + + + + Go Home + Go Back +

NIX AVREA

+

This is a project I've been working on since April 2024. It's probably the longest-running personal project I've ever done and has been a monumental undertaking so far.

+

I'm unsure how much I want to reveal about this project while I'm developing it, I want the experience to be as novel as possible once it's out. I think I'll probably stick to posting about it here on my site and the occasional YouTube video until it's closer to ready.

+

About the Project

+

NIX AVREA is the codename for my first game project. The game is highly experimental and features mechanics that (as far as I know) have never been attempted. The game is centered around dynamic content, using steganographic techniques to embed binary payloads inside of asset files in order to construct the game world from a directory on the player's filesystem.

+

There is a ton of stuff that's already implemented for this project and I'll gradually add more to the following directories explaining in-depth some of the components:

+
++-- mechanics/
++-- design/
++-- narrative/
+    
+ + + \ No newline at end of file diff --git a/projects/piss_daemon/index.html b/projects/piss_daemon/index.html new file mode 100644 index 0000000..5cb9481 --- /dev/null +++ b/projects/piss_daemon/index.html @@ -0,0 +1,43 @@ + + + + + + Piss Daemon - soaos + + + + Go Home + Go Back +

Piss Daemon

+

About

+

This is a D-Bus daemon (pissd) and client (piss-level) that monitor the international + space station's urine tank level.

+

I have it integrated into my status bar (X version):

+ A screenshot of an X11 statusbar showing the piss daemon piss level next to a toilet icon. +
+	#...
+
+	function piss {
+		PISS_LEVEL="$(piss-level)";
+		if [ -n "$PISS_LEVEL" ]; then
+			echo " ξ½― ${PISS_LEVEL}%";
+		fi;
+	}
+
+	#...
+
+	while true; do
+		xsetroot -name "$(piss)$(batt)$(datetime)";
+		sleep 1;
+	done;
+	
+

I made this pretty much entirely so that I could call a program "piss daemon".

+

External Links

+ + + + \ No newline at end of file diff --git a/projects/piss_daemon/statusbar.png b/projects/piss_daemon/statusbar.png new file mode 100644 index 0000000..b98e021 Binary files /dev/null and b/projects/piss_daemon/statusbar.png differ diff --git a/public/CNAME b/public/CNAME deleted file mode 100644 index 4a54f74..0000000 --- a/public/CNAME +++ /dev/null @@ -1 +0,0 @@ -soaos.dev diff --git a/public/blog/blacklight_shader/blacklight.png b/public/blog/blacklight_shader/blacklight.png deleted file mode 100644 index 2c5caf1..0000000 Binary files a/public/blog/blacklight_shader/blacklight.png and /dev/null differ diff --git a/public/blog/blacklight_shader/index.html b/public/blog/blacklight_shader/index.html deleted file mode 100644 index db4b54e..0000000 --- a/public/blog/blacklight_shader/index.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - Creating a Blacklight Shader - soaos - - - - Go Home - Go Back -

Creating a Blacklight Shader

- - NOTE: THIS POST WAS TRANSFERRED FROM MARKDOWN BY HAND SO I MIGHT HAVE MISSED SOME STUFF SORRY - -

today i wanted to take a bit of time to write about a shader i implemented for my in-progress game project (more - on that soonβ„’)

-

i wanted to create a "blacklight" effect, where specific lights could reveal part of the base texture. this - shader works with spot lights only, but could be extended to work with point lights

-
- Example of shader running, showing hidden writing on a wall -
Example of shader running, showing hidden writing on a wall.
-
- -

i wrote this shader in wgsl for a bevy engine project, but - it should translate easily to other shading languages

- -

the finished shader can be found as part of this repo

- -

shader inputs

- -

- for this shader, i wanted the following features: -

- - for this to work i need the following information about each light: - - - i also need some info from the vertex shader: - -

-

bevy's default pbr vertex shader provides this information, but as long as you can get this info into your - fragment - shader you should be good to go

- -

lastly i'll take a base color texture and a sampler

- -

- with all of that, i can start off the shader by setting up the inputs and fragment entry point: - -

-	#import bevy_pbr::forward_io::VertexOutput;
-
-	struct BlackLight {
-		position: vec3<f32>,
-		direction: vec3<f32>,
-		range: f32,
-		inner_angle: f32,
-		outer_angle: f32,
-	}
-
-	@group(2) @binding(0) var<storage> lights: array<BlackLight>;
-	@group(2) @binding(1) var base_texture: texture_2d<f32>;
-	@group(2) @binding(2) var base_sampler: sampler;
-
-	@fragment
-	fn fragment(
-		in: VertexOutput,
-	) -> @location(0) vec4<f32> {
-	}
-		
- (bevy uses group 2 for custom shader bindings) -

- -

- since the number of lights is dynamic, i use a storage buffer to store - that information -

- -

shader calculations

- -

the first thing we'll need to know is how close to looking at the fragment the light source - is

- -

- we can get this information using some interesting math: - -

-	let light = lights[0];
-	let light_to_fragment_direction = normalize(in.world_position.xyz - light.position);
-	let light_to_fragment_angle = acos(dot(light.direction, light_to_fragment_direction));
-		
- - the first step of this is taking the dot product of light direction and the direction from - the light to the fragment -

- -

since both direction vectors are normalized, the dot product will be between -1.0 and 1.0

- -

- the dot product of two unit vectors is the cosine of the angle between them (proof - here) -

- -

- therefore, we take the arccosine of that dot product to get the angle between the light and - the fragment -

- -

- once we have this angle we can plug it in to a falloff based on the angle properties of the - light: - -

-	let angle_inner_factor = light.inner_angle/light.outer_angle;
-	let angle_factor = linear_falloff_radius(light_to_fragment_angle / light.outer_angle, angle_inner_factor);
-		
-
-	fn linear_falloff_radius(factor: f32, radius: f32) -> f32 {
-		if factor < radius { return 1.0; } else { 
-			return 1.0 - (factor - radius) / (1.0 - radius); 
-		} 
-	}
-		
-

-

- next, we need to make sure the effect falls off properly over distance we can do this by getting the distance - from the light to - the fragment and normalizing it with the range of the light before plugging that into an inverse square falloff - we'll use squared distance to avoid expensive and unnecessary square root operations: -

-	let light_distance_squared=distance_squared(in.world_position.xyz, light.position);
-	let distance_factor=inverse_falloff_radius(saturate(light_distance_squared / (light.range * light.range)), 0.5);
-		
-
-	fn distance_squared(a: vec3f, b: vec3f) -> f32 {
-		let vec = a - b;
-		return dot(vec, vec);
-	}
-
-	fn inverse_falloff(factor: f32) -> f32 {
-		return pow(1.0 - factor, 2.0);
-	}
-
-	fn inverse_falloff_radius(factor: f32, radius: f32) -> f32 {
-		if factor < radius { return 1.0; } else { 
-			return inverse_falloff((factor - radius) / (1.0 - radius)); 
-		}
-	}
-		
-

-

- now we'll have a float multiplier between 0.0 and 1.0 for our angle and distance to the light we can get the - resulting color by multiplying these with the base color texture: -

-	let base_color = textureSample(base_texture, base_sampler, in.uv);
-	let final_color=base_color * angle_factor * distance_factor;
-		
- this works for one light, but we need to refactor it to loop over all the provided blacklights: -
-
-	@fragment fn fragment( in: VertexOutput ) -> @location(0) vec4<f32> {
-		let base_color = textureSample(base_texture, base_sampler, in.uv);
-		var final_color = vec4f(0.0, 0.0, 0.0, 0.0);
-		for (var i = u32(0); i < arrayLength(&lights); i = i+1) { 
-			let light=lights[i];
-			let light_to_fragment_direction = normalize(in.world_position.xyz - light.position);
-			let light_to_fragment_angle = acos(dot(light.direction, light_to_fragment_direction));
-			let angle_inner_factor = light.inner_angle / light.outer_angle;
-			let angle_factor = linear_falloff_radius(light_to_fragment_angle / light.outer_angle, angle_inner_factor);
-			let light_distance_squared = distance_squared(in.world_position.xyz, light.position);
-			let distance_factor = inverse_falloff_radius(saturate(light_distance_squared / (light.range * light.range)), 0.5);
-			final_color = saturate(final_color + base_color * angle_factor * distance_factor);
-		} 
-		return final_color; 
-	}
-		
- and with that, the shader is pretty much complete you can view the full completed shader code here -

-

have fun!

- - - \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index eed9644..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 725c752..0000000 --- a/public/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - soaos - - - -

soaos

- -

Hey, welcome to my site, or what's left of it, LMAO.

- -

About

-

- I'm Silas Bartha, an "artist" and professional software developer. - I do full stack for my work and in my free time I mostly work on eccentric software projects which you can read - about here (soon). -

- -

- Recently I've been trying to branch out a bit. - I have a few skills I'd like to pick up over the course of the next few years, - which will help me better execute future projects. - It's hard because I hate being awful at things haha. -

- -

Stuff on this Server (Under Construction)

- - -

See me

- - -

Webrings

- - EVILRING - - - - \ No newline at end of file diff --git a/public/projects/games/NIX_AVREA/index.html b/public/projects/games/NIX_AVREA/index.html deleted file mode 100644 index 47c914b..0000000 --- a/public/projects/games/NIX_AVREA/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - NIX AVREA - - - - Go Home - Go Back -

NIX AVREA

-

This is a project I've been working on since April 2024. It's probably the longest-running personal project I've ever done and has been a monumental undertaking so far.

-

I'm unsure how much I want to reveal about this project while I'm developing it, I want the experience to be as novel as possible once it's out. I think I'll probably stick to posting about it here on my site and the occasional YouTube video until it's closer to ready.

-

About the Project

-

NIX AVREA is the codename for my first game project. The game is highly experimental and features mechanics that (as far as I know) have never been attempted. The game is centered around dynamic content, using steganographic techniques to embed binary payloads inside of asset files in order to construct the game world from a directory on the player's filesystem.

-

There is a ton of stuff that's already implemented for this project and I'll gradually add more to the following directories explaining in-depth some of the components:

-
-+-- mechanics/
-+-- design/
-+-- narrative/
-    
- - - \ No newline at end of file diff --git a/public/projects/piss_daemon/index.html b/public/projects/piss_daemon/index.html deleted file mode 100644 index 5cb9481..0000000 --- a/public/projects/piss_daemon/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - Piss Daemon - soaos - - - - Go Home - Go Back -

Piss Daemon

-

About

-

This is a D-Bus daemon (pissd) and client (piss-level) that monitor the international - space station's urine tank level.

-

I have it integrated into my status bar (X version):

- A screenshot of an X11 statusbar showing the piss daemon piss level next to a toilet icon. -
-	#...
-
-	function piss {
-		PISS_LEVEL="$(piss-level)";
-		if [ -n "$PISS_LEVEL" ]; then
-			echo " ξ½― ${PISS_LEVEL}%";
-		fi;
-	}
-
-	#...
-
-	while true; do
-		xsetroot -name "$(piss)$(batt)$(datetime)";
-		sleep 1;
-	done;
-	
-

I made this pretty much entirely so that I could call a program "piss daemon".

-

External Links

- - - - \ No newline at end of file diff --git a/public/projects/piss_daemon/statusbar.png b/public/projects/piss_daemon/statusbar.png deleted file mode 100644 index b98e021..0000000 Binary files a/public/projects/piss_daemon/statusbar.png and /dev/null differ diff --git a/public/things_i_like/music/867.png b/public/things_i_like/music/867.png deleted file mode 100644 index d416100..0000000 Binary files a/public/things_i_like/music/867.png and /dev/null differ diff --git a/public/things_i_like/music/act_ii.jpg b/public/things_i_like/music/act_ii.jpg deleted file mode 100644 index 97b2e82..0000000 Binary files a/public/things_i_like/music/act_ii.jpg and /dev/null differ diff --git a/public/things_i_like/music/apollo.jpg b/public/things_i_like/music/apollo.jpg deleted file mode 100644 index 9c742ee..0000000 Binary files a/public/things_i_like/music/apollo.jpg and /dev/null differ diff --git a/public/things_i_like/music/atebts.jpg b/public/things_i_like/music/atebts.jpg deleted file mode 100644 index ca68692..0000000 Binary files a/public/things_i_like/music/atebts.jpg and /dev/null differ diff --git a/public/things_i_like/music/departure_songs.jpg b/public/things_i_like/music/departure_songs.jpg deleted file mode 100644 index 2699d5d..0000000 Binary files a/public/things_i_like/music/departure_songs.jpg and /dev/null differ diff --git a/public/things_i_like/music/index.html b/public/things_i_like/music/index.html deleted file mode 100644 index 46ebc1f..0000000 --- a/public/things_i_like/music/index.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Music I Like - soaos - - - - Go Home - Go Back -

Music I Like

-

I might organize this better at some point, but for now there's no particular order to these. I just want to - share - my awful taste with everyone LMAO.

-

Albums (Click to Listen on YouTube)

-

I only included one album per artist in order to avoid making this list infinitely long LOL. It was difficult for - some of these bands...

- -
- Cover art for 867 by This is the Glasshouse -
This is the Glasshouse - 867
-
-
- -
- Cover art for wetdream by Willy Rodriguez -
Willy Rodriguez - wetdream
-
-
- -
- Cover art for Act II by The Dear Hunter -
The Dear Hunter - Act II: The Meaning of, and All Things Regarding Ms. Leading
-
-
- -
- Cover art for Good Apollo, I'm Burning Star IV, Volume One: From Fear Through the Eyes of Madness by Coheed and Cambria -
Coheed and Cambria - Good Apollo, I'm Burning Star IV, Volume One: From Fear Through the Eyes of - Madness
-
-
- -
- Cover art for Twin Fantasy by Car Seat Headrest -
Car Seat Headrest - Twin Fantasy
-
-
- -
- Cover art for Jiminy by Bear Ghost -
Bear Ghost - Jiminy
-
-
- -
- Cover art for Lift Your Skinny Fists Like Antennas to Heaven by Godspeed You! Black Emperor -
Godspeed You! Black Emperor - Lift Your Skinny Fists Like Antennas to Heaven
-
-
- -
- Cover art for Departure Songs by We Lost the Sea -
We Lost the Sea - Departure Songs
-
-
- -
- Cover art for Above the Earth, Below the Sky by If These Trees Could Talk -
If These Trees Could Talk - Above the Earth, Below the Sky
-
-
- - - \ No newline at end of file diff --git a/public/things_i_like/music/jiminy.jpg b/public/things_i_like/music/jiminy.jpg deleted file mode 100644 index a216de4..0000000 Binary files a/public/things_i_like/music/jiminy.jpg and /dev/null differ diff --git a/public/things_i_like/music/lysf.jpg b/public/things_i_like/music/lysf.jpg deleted file mode 100644 index 8605559..0000000 Binary files a/public/things_i_like/music/lysf.jpg and /dev/null differ diff --git a/public/things_i_like/music/twin_fantasy.jpg b/public/things_i_like/music/twin_fantasy.jpg deleted file mode 100644 index f83e135..0000000 Binary files a/public/things_i_like/music/twin_fantasy.jpg and /dev/null differ diff --git a/public/things_i_like/music/wetdream.png b/public/things_i_like/music/wetdream.png deleted file mode 100644 index 862544c..0000000 Binary files a/public/things_i_like/music/wetdream.png and /dev/null differ diff --git a/things_i_like/music/867.png b/things_i_like/music/867.png new file mode 100644 index 0000000..d416100 Binary files /dev/null and b/things_i_like/music/867.png differ diff --git a/things_i_like/music/act_ii.jpg b/things_i_like/music/act_ii.jpg new file mode 100644 index 0000000..97b2e82 Binary files /dev/null and b/things_i_like/music/act_ii.jpg differ diff --git a/things_i_like/music/apollo.jpg b/things_i_like/music/apollo.jpg new file mode 100644 index 0000000..9c742ee Binary files /dev/null and b/things_i_like/music/apollo.jpg differ diff --git a/things_i_like/music/atebts.jpg b/things_i_like/music/atebts.jpg new file mode 100644 index 0000000..ca68692 Binary files /dev/null and b/things_i_like/music/atebts.jpg differ diff --git a/things_i_like/music/departure_songs.jpg b/things_i_like/music/departure_songs.jpg new file mode 100644 index 0000000..2699d5d Binary files /dev/null and b/things_i_like/music/departure_songs.jpg differ diff --git a/things_i_like/music/index.html b/things_i_like/music/index.html new file mode 100644 index 0000000..46ebc1f --- /dev/null +++ b/things_i_like/music/index.html @@ -0,0 +1,77 @@ + + + + + Music I Like - soaos + + + + Go Home + Go Back +

Music I Like

+

I might organize this better at some point, but for now there's no particular order to these. I just want to + share + my awful taste with everyone LMAO.

+

Albums (Click to Listen on YouTube)

+

I only included one album per artist in order to avoid making this list infinitely long LOL. It was difficult for + some of these bands...

+ +
+ Cover art for 867 by This is the Glasshouse +
This is the Glasshouse - 867
+
+
+ +
+ Cover art for wetdream by Willy Rodriguez +
Willy Rodriguez - wetdream
+
+
+ +
+ Cover art for Act II by The Dear Hunter +
The Dear Hunter - Act II: The Meaning of, and All Things Regarding Ms. Leading
+
+
+ +
+ Cover art for Good Apollo, I'm Burning Star IV, Volume One: From Fear Through the Eyes of Madness by Coheed and Cambria +
Coheed and Cambria - Good Apollo, I'm Burning Star IV, Volume One: From Fear Through the Eyes of + Madness
+
+
+ +
+ Cover art for Twin Fantasy by Car Seat Headrest +
Car Seat Headrest - Twin Fantasy
+
+
+ +
+ Cover art for Jiminy by Bear Ghost +
Bear Ghost - Jiminy
+
+
+ +
+ Cover art for Lift Your Skinny Fists Like Antennas to Heaven by Godspeed You! Black Emperor +
Godspeed You! Black Emperor - Lift Your Skinny Fists Like Antennas to Heaven
+
+
+ +
+ Cover art for Departure Songs by We Lost the Sea +
We Lost the Sea - Departure Songs
+
+
+ +
+ Cover art for Above the Earth, Below the Sky by If These Trees Could Talk +
If These Trees Could Talk - Above the Earth, Below the Sky
+
+
+ + + \ No newline at end of file diff --git a/things_i_like/music/jiminy.jpg b/things_i_like/music/jiminy.jpg new file mode 100644 index 0000000..a216de4 Binary files /dev/null and b/things_i_like/music/jiminy.jpg differ diff --git a/things_i_like/music/lysf.jpg b/things_i_like/music/lysf.jpg new file mode 100644 index 0000000..8605559 Binary files /dev/null and b/things_i_like/music/lysf.jpg differ diff --git a/things_i_like/music/twin_fantasy.jpg b/things_i_like/music/twin_fantasy.jpg new file mode 100644 index 0000000..f83e135 Binary files /dev/null and b/things_i_like/music/twin_fantasy.jpg differ diff --git a/things_i_like/music/wetdream.png b/things_i_like/music/wetdream.png new file mode 100644 index 0000000..862544c Binary files /dev/null and b/things_i_like/music/wetdream.png differ -- cgit v1.2.3