diff options
Diffstat (limited to 'public')
18 files changed, 0 insertions, 432 deletions
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 Binary files differdeleted file mode 100644 index 2c5caf1..0000000 --- a/public/blog/blacklight_shader/blacklight.png +++ /dev/null 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 @@ -<!DOCTYPE html> -<html lang="en"> - -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Creating a Blacklight Shader - soaos</title> -</head> - -<body> - <a href="/">Go Home</a> - <a href="..">Go Back</a> - <h1>Creating a Blacklight Shader</h1> - <font color="red"> - <b>NOTE: THIS POST WAS TRANSFERRED FROM MARKDOWN BY HAND SO I MIGHT HAVE MISSED SOME STUFF SORRY</b> - </font> - <p>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™)</p> - <p>i wanted to create a "blacklight" effect, where specific lights could reveal part of the base texture. this - shader works with <b>spot lights</b> only, but could be extended to work with point lights</p> - <figure> - <img src="blacklight.png" alt="Example of shader running, showing hidden writing on a wall" width="100%"> - <figcaption>Example of shader running, showing hidden writing on a wall.</figcaption> - </figure> - - <p>i wrote this shader in wgsl for a <a href="https://bevyengine.org" target="_blank">bevy engine</a> project, but - it should translate easily to other shading languages</p> - - <p>the finished shader can be found as part of <a href="https://git.soaos.dev/soaos/bevy_blacklight_material" - target="_blank">this repo</a></p> - - <h2>shader inputs</h2> - - <p> - for this shader, i wanted the following features: - <ul> - <li> - the number of lights should be dynamic - </li> - <li> - the revealed portion of the object should match the area illuminated by each light - </li> - <li> - the falloff of the light over distance should match the fading of the object - </li> - </ul> - - for this to work i need the following information about each light: - <ul> - <li> - position (world space) - </li> - <li> - direction (world space) - </li> - <li> - range - </li> - <li> - inner and outer angle - </li> - <li> - these will control the falloff of the light at its edges - </li> - <li> - outer angle should be less than pi/2 radians - </li> - <li> - inner angle should be less than the outer angle - </li> - </ul> - - i also need some info from the vertex shader: - <ul> - <li> - position (<b>world space!</b>) - </li> - <li> - uv - </li> - </ul> - </p> - <p>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</p> - - <p>lastly i'll take a base color texture and a sampler</p> - - <p> - with all of that, i can start off the shader by setting up the inputs and fragment entry point: - - <pre> - #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> { - } - </pre> - (bevy uses group 2 for custom shader bindings) - </p> - - <p> - since the number of lights is dynamic, i use a <a - href="https://google.github.io/tour-of-wgsl/types/arrays/runtime-sized-arrays/">storage buffer</a> to store - that information - </p> - - <h2>shader calculations</h2> - - <p>the first thing we'll need to know is how close to looking at the fragment the light source - is</p> - - <p> - we can get this information using some interesting math: - - <pre> - 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)); - </pre> - - the first step of this is taking the dot product of light direction and the direction from - the light to the fragment - </p> - - <p>since both direction vectors are normalized, the dot product will be between -1.0 and 1.0</p> - - <p> - the dot product of two unit vectors is the cosine of the angle between them (<a - href="https://math.libretexts.org/Bookshelves/Calculus/Calculus_(OpenStax)/12%3A_Vectors_in_Space/12.03%3A_The_Dot_Product#Evaluating_a_Dot_Product">proof - here</a>) - </p> - - <p> - therefore, we take the arccosine of that dot product to get the angle between the light and - the fragment - </p> - - <p> - once we have this angle we can plug it in to a falloff based on the angle properties of the - light: - - <pre> - 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); - </pre> - <pre> - fn linear_falloff_radius(factor: f32, radius: f32) -> f32 { - if factor < radius { return 1.0; } else { - return 1.0 - (factor - radius) / (1.0 - radius); - } - } - </pre> - </p> - <p> - 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: - <pre> - 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); - </pre> - <pre> - 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)); - } - } - </pre> - </p> - <p> - 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: - <pre> - let base_color = textureSample(base_texture, base_sampler, in.uv); - let final_color=base_color * angle_factor * distance_factor; - </pre> - this works for one light, but we need to refactor it to loop over all the provided blacklights: - <pre> - - @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; - } - </pre> - and with that, the shader is pretty much complete you can view the full completed shader code <a - href="https://github.com/soaosdev/bevy_blacklight_material/blob/master/assets/shaders/blacklight_material.wgsl">here</a> - </p> - <p>have fun!</p> -</body> - -</html>
\ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico Binary files differdeleted file mode 100644 index eed9644..0000000 --- a/public/favicon.ico +++ /dev/null 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 @@ -<!DOCTYPE html> -<!-- Hey haha, yeah I wasn't kidding, I'm writing this whole site by hand. --> - -<html lang="en"> - -<head> - <title>soaos</title> -</head> - -<body> - <h1>soaos</h1> - - <p>Hey, welcome to my site, or what's left of it, LMAO.</p> - - <h2>About</h2> - <p> - 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). - </p> - - <p> - 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. - </p> - - <h2>Stuff on this Server (Under Construction)</h2> - <ul> - <li> - <a href="/projects">Projects</a> - </li> - <li> - <a href="https://git.soaos.dev" target="_blank">Gitea</a> - </li> - <li> - <a href="/blog">Blog</a> - </li> - <li> - <a href="/things_i_like">Things I Like</a> - </li> - </ul> - - <h2>See me</h2> - <ul> - <li>E-Mail: <a href="mailto:silas@soaos.dev" rel="me">silas@soaos.dev</a></li> - <li>YouTube: <a href="https://youtube.com/@soaosdev" rel="me" target="_blank">@soaosdev</a></li> - <li>Mastodon: <a href="https://furry.engineer/@soaos" rel="me" target="_blank">soaos@furry.engineer</a></li> - </ul> - - <h2>Webrings</h2> - <a href="https://evilr.ing/soaos/previous">←</a> - <a href="https://evilr.ing">EVILRING</a> - <a href="https://evilr.ing/soaos/next">→</a> -</body> - -</html>
\ 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 @@ -<!DOCTYPE html> -<html lang="en"> - -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>NIX AVREA</title> -</head> - -<body> - <a href="/">Go Home</a> - <a href="..">Go Back</a> - <h1>NIX AVREA</h1> - <p>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.</p> - <p>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.</p> - <h2>About the Project</h2> - <p>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.</p> - <p>There is a <i>ton</i> 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:</p> - <pre> -+-- <a href="#">mechanics/</a> -+-- <a href="#">design/</a> -+-- <a href="#">narrative/</a> - </pre> -</body> - -</html>
\ 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 @@ -<html lang="en"> - -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Piss Daemon - soaos</title> -</head> - -<body> - <a href="/">Go Home</a> - <a href="..">Go Back</a> - <h1>Piss Daemon</h1> - <h2>About</h2> - <p>This is a D-Bus daemon (<code>pissd</code>) and client (<code>piss-level</code>) that monitor the international - space station's urine tank level.</p> - <p>I have it integrated into my status bar (X version):</p> - <img src="statusbar.png" - alt="A screenshot of an X11 statusbar showing the piss daemon piss level next to a toilet icon."> - <pre> - #... - - 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; - </pre> - <p>I made this pretty much entirely so that I could call a program "piss daemon".</p> - <h2>External Links</h2> - <ul> - <li><a href="https://git.soaos.dev/soaos/piss-daemon" target="_blank">git repo</a></li> - </ul> -</body> - -</html>
\ No newline at end of file diff --git a/public/projects/piss_daemon/statusbar.png b/public/projects/piss_daemon/statusbar.png Binary files differdeleted file mode 100644 index b98e021..0000000 --- a/public/projects/piss_daemon/statusbar.png +++ /dev/null diff --git a/public/things_i_like/music/867.png b/public/things_i_like/music/867.png Binary files differdeleted file mode 100644 index d416100..0000000 --- a/public/things_i_like/music/867.png +++ /dev/null diff --git a/public/things_i_like/music/act_ii.jpg b/public/things_i_like/music/act_ii.jpg Binary files differdeleted file mode 100644 index 97b2e82..0000000 --- a/public/things_i_like/music/act_ii.jpg +++ /dev/null diff --git a/public/things_i_like/music/apollo.jpg b/public/things_i_like/music/apollo.jpg Binary files differdeleted file mode 100644 index 9c742ee..0000000 --- a/public/things_i_like/music/apollo.jpg +++ /dev/null diff --git a/public/things_i_like/music/atebts.jpg b/public/things_i_like/music/atebts.jpg Binary files differdeleted file mode 100644 index ca68692..0000000 --- a/public/things_i_like/music/atebts.jpg +++ /dev/null diff --git a/public/things_i_like/music/departure_songs.jpg b/public/things_i_like/music/departure_songs.jpg Binary files differdeleted file mode 100644 index 2699d5d..0000000 --- a/public/things_i_like/music/departure_songs.jpg +++ /dev/null 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 @@ -<!DOCTYPE html> -<html lang="en"> - -<head> - <title>Music I Like - soaos</title> -</head> - -<body> - <a href="/">Go Home</a> - <a href="..">Go Back</a> - <h1>Music I Like</h1> - <p>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.</p> - <h2>Albums (Click to Listen on YouTube)</h2> - <p>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...</p> - <a href="https://www.youtube.com/watch?v=W5YsHH9Mihw" target="_blank"> - <figure> - <img src="867.png" alt="Cover art for 867 by This is the Glasshouse"> - <figcaption>This is the Glasshouse - 867</figcaption> - </figure> - </a> - <a href="https://www.youtube.com/watch?v=TeqcmeW0T9E" target="_blank"> - <figure> - <img src="wetdream.png" alt="Cover art for wetdream by Willy Rodriguez"> - <figcaption>Willy Rodriguez - wetdream</figcaption> - </figure> - </a> - <a href="https://www.youtube.com/watch?v=nNaXxAPRgNQ" target="_blank"> - <figure> - <img src="act_ii.jpg" alt="Cover art for Act II by The Dear Hunter"> - <figcaption>The Dear Hunter - Act II: The Meaning of, and All Things Regarding Ms. Leading</figcaption> - </figure> - </a> - <a href="https://www.youtube.com/watch?v=Z8zpd4JxgDM" target="_blank"> - <figure> - <img src="apollo.jpg" - alt="Cover art for Good Apollo, I'm Burning Star IV, Volume One: From Fear Through the Eyes of Madness by Coheed and Cambria"> - <figcaption>Coheed and Cambria - Good Apollo, I'm Burning Star IV, Volume One: From Fear Through the Eyes of - Madness</figcaption> - </figure> - </a> - <a href="https://www.youtube.com/watch?v=bpYGoPyqigE" target="_blank"> - <figure> - <img src="twin_fantasy.jpg" alt="Cover art for Twin Fantasy by Car Seat Headrest"> - <figcaption>Car Seat Headrest - Twin Fantasy</figcaption> - </figure> - </a> - <a href="https://www.youtube.com/watch?v=u5kpUlJGTrM" target="_blank"> - <figure> - <img src="jiminy.jpg" alt="Cover art for Jiminy by Bear Ghost"> - <figcaption>Bear Ghost - Jiminy</figcaption> - </figure> - </a> - <a href="https://www.youtube.com/watch?v=5eF6hNLp8IQ" target="_blank"> - <figure> - <img src="lysf.jpg" - alt="Cover art for Lift Your Skinny Fists Like Antennas to Heaven by Godspeed You! Black Emperor"> - <figcaption>Godspeed You! Black Emperor - Lift Your Skinny Fists Like Antennas to Heaven</figcaption> - </figure> - </a> - <a href="https://www.youtube.com/watch?v=SBOVkptjJhE" target="_blank"> - <figure> - <img src="departure_songs.jpg" alt="Cover art for Departure Songs by We Lost the Sea"> - <figcaption>We Lost the Sea - Departure Songs</figcaption> - </figure> - </a> - <a href="https://www.youtube.com/watch?v=FkITImYd4w4&list=PLXRMC-u2zpJ5KnoCQaBNSkRbqaW4c70vn" target="_blank"> - <figure> - <img src="atebts.jpg" alt="Cover art for Above the Earth, Below the Sky by If These Trees Could Talk"> - <figcaption>If These Trees Could Talk - Above the Earth, Below the Sky</figcaption> - </figure> - </a> -</body> - -</html>
\ No newline at end of file diff --git a/public/things_i_like/music/jiminy.jpg b/public/things_i_like/music/jiminy.jpg Binary files differdeleted file mode 100644 index a216de4..0000000 --- a/public/things_i_like/music/jiminy.jpg +++ /dev/null diff --git a/public/things_i_like/music/lysf.jpg b/public/things_i_like/music/lysf.jpg Binary files differdeleted file mode 100644 index 8605559..0000000 --- a/public/things_i_like/music/lysf.jpg +++ /dev/null diff --git a/public/things_i_like/music/twin_fantasy.jpg b/public/things_i_like/music/twin_fantasy.jpg Binary files differdeleted file mode 100644 index f83e135..0000000 --- a/public/things_i_like/music/twin_fantasy.jpg +++ /dev/null diff --git a/public/things_i_like/music/wetdream.png b/public/things_i_like/music/wetdream.png Binary files differdeleted file mode 100644 index 862544c..0000000 --- a/public/things_i_like/music/wetdream.png +++ /dev/null |
