diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-09-11 17:25:39 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-09-11 17:25:39 +0530 |
| commit | 4e6dbd91b5f33dcb8d3e739f173118801242b7e1 (patch) | |
| tree | 4bccd7889906b3cb039184229a63d52a22f22040 /src/main/resources/shaders/modules/sdf.cs | |
| parent | 33f12612f9a34bc86faf314ef10e035a35d26cc9 (diff) | |
| download | art-playground-openrndr-4e6dbd91b5f33dcb8d3e739f173118801242b7e1.tar.gz art-playground-openrndr-4e6dbd91b5f33dcb8d3e739f173118801242b7e1.zip | |
Overdid the raymarch experiment
Diffstat (limited to 'src/main/resources/shaders/modules/sdf.cs')
| -rw-r--r-- | src/main/resources/shaders/modules/sdf.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/resources/shaders/modules/sdf.cs b/src/main/resources/shaders/modules/sdf.cs new file mode 100644 index 0000000..8121b18 --- /dev/null +++ b/src/main/resources/shaders/modules/sdf.cs @@ -0,0 +1,12 @@ +float sdf_circle(in vec3 p, in float radius) { + return length(p) - radius; +} + +float sdf_plane(in vec3 p, in vec3 normal, in float offset) { + return dot(p, normal) + offset; +} + +float sdf_box(in vec3 p, in vec3 dimens, in float rounding) { + vec3 q = abs(p) - dimens + rounding; + return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0) - rounding; +} |
