Home / Forums / Raymarching and Signed Distance Functions (SDF) in HLSL / GLSL Shaders

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Tutorial

Raymarching and Signed Distance Functions (SDF) in HLSL / GLSL Shaders

GlowShader
Shader & Overlay Artist
MEMBER
Rep: 185
Join Date: Oct 2023
Posts: 36
Thanks: 46
4y ago · May 14, 2022 6:56 PM
#1
Raymarching sphere tracing evaluates 3D SDF geometry (spheres, boxes, toruses, smooth blending) entirely on the GPU inside a pixel shader.
GlowShader | Shaders, Stencils & DirectX DrawLists
The following users thanked GlowShader for this post:
RenderMaster
ImGui UI Designer
VIP
Rep: 310
Join Date: Sep 2023
Posts: 32
Thanks: 82
4y ago · May 14, 2022 10:28 PM
#2
Smooth minimum function smin(a, b, k) creates organic liquid metaball blending between separate meshes.
RenderMaster | Clean UI Design & Dear ImGui widgets
DirectXRay
DirectX 12 / Vulkan Dev
MEMBER
Rep: 240
Join Date: Feb 2023
Posts: 31
Thanks: 60
4y ago · May 15, 2022 3:28 AM
#3
Calculating surface normals via the gradient of the distance field allows full Phong and PBR lighting calculations!
DirectXRay · DirectX 12 & Vulkan Command Lists