NVScene 2015 Session: How to Create Content with Signed Distance Functions (Johann Korndörfer)

35K views · 11 years ago · talk · expert · evergreen

Johann Korndorfer of the Mercury demogroup explains at NVScene 2015 how to build sophisticated content by raymarching signed distance functions. It teaches the technique that powers much of the shader and demoscene look.

HN people recommend it as the excellent talk on building up scenes from raymarched distance functions, and link it from threads on Shadertoy and 64k intros.

“this is an excellent talk on the subject”

4 comments from Hacker News

t
@teamhappy2018 · in “Planet Shadertoy”
Here's a presentation from one of the mercury guys explaining how to do that kind of thing: ▶ this video Also, elevated from RGBA should probably be mentioned since iq (link) is the guy behind Shadertoy. (Also because it's pretty.) link
RecommendsView on HN
I
@Impossible2017 · in “Making WebGL Dance: How, Where, and What to Draw (2013)”
Hg (link) is a great resource. I'm not a fan of the non-commercial license. The intro on the top of the site has a lot of great links to resources outside of iq, including the pouet.net thread on Raymarching, John Hart's original sphere tracing paper, and enhanced sphere tracing, as well as the author's original talk from NVScene 2015 (▶ this video). Definitely check out all of these resources. If you're more interested in signed distance fields outside of the shadertoy\demo scene use cases there are a lot of interesting resources out there written by people using them in more complex contexts. Alex Evans (Media Molecule) Dreams talk is awesome. You can see the talk here (link) and read the slides here (link). link covers how to generate meshes. With modern hardware with ballot\shuffle there are probably more efficient ways to do this in a compute shader now, but the talk is still good. Epic games siggraph presentation (link) is a good explanation of how UE4 uses signed distance fields for ambient occlusion and shadows. Q-Games presentation (link) on how the now defunct Game Tomorrow Children uses signed distance fields for dynamic world space reflections. Voxel Quest (link), a "failed" kickstarter project, has some good write ups of how he's built the engine over the years as well as source code. Unbound.io gave a talk at GTC 2017 (link) that goes into some detail on their signed distance field VR sculpting app. There are of course more resources than that, and just browsing shader toy and reading people's shaders can give you a ton of knowledge, but that's the short list of resources that I've found enlightening over the years.
RecommendsView on HN
w
@westoncb2017 · in “How a 64k intro is made”
I think that's a pretty nice overview you have. One thing I would clarify is about how the objects in the scene are represented mathematically: it's done using 'signed distance functions' so every object you have in the scene is actually created through one of these functions which takes a point in 3D space and returns the distance to the nearest point on the object's surface to that point—which does, as you say, make the object/ray intersection testing trivial (the return value of this function is the radius of the sphere used to step along the ray). The other basic components when creating scenes to be raymarched are distance functions which combine other distance functions together. The simplest cases are just union and intersection, but it's easy to get more interesting things like smoothly blending objects together. This page is a nice reference of these 'combining' functions as well as distance functions for geometric primitives: link I think that combining power is one of the main reasons to use raymarching/distance functions: building procedural content this way is faaar easier than trying to knit triangle meshes together. Additionally, if anyone wants to go a little further on the subject of building up sophisticated content by raymarching distance functions, this is an excellent talk on the subject: ▶ this video
RecommendsView on HN
z
@zellyn2016 · in “Interactive editing of basic distance field operation”
I really like the SDF visualization in this tutorial: ▶ this video
RecommendsView on HN