# Questions tagged [signed-distance-field]

The tag has no usage guidance.

27 questions
Filter by
Sorted by
Tagged with
1 vote
175 views

### How to implement skeletal animation for Signed Distance Field models?

When animating a 3D model, we want the surface of the model to remain continuous (such that, for instance, the limbs do not seem to slide on the torso, but stay attached at their position). In a ...
96 views

### How to calculate the world position of pixels in an HLSL script?

I want to make a simple ray marching loop in the fragment shader. I think the main issue is that I'm not giving the correct world position input. Here is my current attempt: ...
71 views

### Comparison of SDFs with Normal Map Rendering for 2D Sprites

Prior note: I very drastically edited this question after understanding that SDFs and normal map rendering "do not solve the same problem." (Thank you, @DMGregory.) However, the question's ...
• 101
1 vote
599 views

### Explain how Inigo Quilez calculates SDF box normals

Inigo Quilez's website has a page of 3D ray-surface intersectors, one of which is for a basic 3D box: ...
• 584
44 views

### Distance fields reacting to camera in a odd way

I have a material using distance fields that reacts in chunks as I bring the camera closer. It's almost as if it's reacting to a distance field with the camera but much larger and less gradual.This ...
412 views

### Get the closest point on an SDF

Is there a cheap and effective way to get the closest point on an SDF? (signed distance field). CodeParade made a video on a game he developed that uses SDF collisions with a sphere, how did he do it? ...
1k views

### How to calculate SDF intersection for union and primitive?

First I union A1 and A2 (with min). A2 distance is closest. Then I do intersect (max) between the union A (min of a1 and a2) and B rectangle. Distance to A2 is result. But that doesn't help me to to ...
143 views

### How to send SDF equation to GPU shader?

I am working on a sandbox app that model stuff using SDF and its operators. I want to do the actual rendering on GPU. So once the SDF is defined (ex. box union with sphere, etc.) how do I push it to ...
• 171
44 views

### How can I achieve this "stroked lines" effect?

I have a collection of arbitrary vertices and edges that are connected, but which do not necessarily form triangles. These vertices and edges mostly fall along a flat plane, but have some height ...
• 591
305 views

### How to construct a octree density from SDF for MC

It very clear how it works with a regular grid. 3 inner loops - x, y, z over some size. The smaller the cells, so will be the mesh more detailed. But how about octree. I know i can stich different ...
• 171
1 vote
2k views

### How can I generate mesh distance fields at runtime on a procedural mesh in unreal engine 4.26?

I am building a simulation game that and I that allows the player to create procedural buildings rather than placing static scenery items. If possible, I would like to write a shader that can take the ...
• 11
116 views

### How are objects represented in raymarching shaders

How does one represent geometry in raymarching shader? Say I wanted to pass a tree of SDF primitive shaders. My current idea is to pass texture containing their positions as rgb and type as alpha ...
86 views

### Understanding arguments to a signed distance field function

I'm looking into drawing a box using Inigo Quilez's code: ...
1 vote
799 views

### Raymarching signed distance function resulting in holes on surface - step size required?

I've been learning about raymarching and signed distance functions, and I implemented a raymarching fragment shader in Unity. It works fine for geometric shapes such as cubes and spheres, but when I ...
• 157
50 views

### Indexing a point outside of a 3D signed distance field

I have a 3D signed distance field that is voxelized into a grid, surrounding an object. However, I would like to query the signed distance field to determine the shortest possible distance between ...
5k views

### Freetype: create Signed Distance Field based font

I am trying to implement Font Rendering in my OpenGL C++ game. I read many articles on the subject and got to know different methods, but I am still learning. Valve has published a paper for Signed ...
142 views

### SDF - indexing the folding space

I had been repetitively watching this part of the video just trying to understand his point: you can optionally use the return value as cell index ... as random seed to introduce some variation .....
• 155
832 views

### Generate screen space distance field from depth buffer

I've been wanting to try out raymarching on real 3D scenes to implement effects like AO, soft-shadows and such. I pretty much know how to use signed distance functions (as described by Inigo Quilez) ...
• 301
330 views

### GLSL - Signed Distance Field vs normal Loop

I am fairly new in GLSL and only recently discover Signed Distance Field. I am trying to figure out how SDF can perform so well ...
• 155
258 views

### Virtual infinite plane in shadow map

I have a WebGL deferred rendering pipeline, where I'm rendering shadow map with VSM technique. The goal is that the scene, or model, is hovering in space, and in addition to casting shadow on itself, ...
• 173
1 vote
1k views

### Text rendering techniques for games

I'm researching text rendering techniques for 3D applications, and I'm having a hard time finding information on the topic. Do you know of any other methods of text rendering that are actually used in ...
• 186
3k views

### Signed Distance Fields: How are different colour channels used to improve output of sharp corners?

The naive approach to implementing signed distance field font rendering suffers quality issues where sharp corners get softened (either outward- or inward-facing corners, i.e. convex or concave ...
• 29.4k
1k views

### 2D Distance Field as collision handler method

Pixeljunk Shooter has really cool fluid simulation. I found the dev's video explaining what they did. Here I understand that it is particle based simulation Smoothed Particle Hydrodynamic I can ...
4k views

### How to smooth mask texture edges correctly regardless it's size

I have a texture intended as a mask. The texture type is GL_R32F (32 bit float) and the data inside is a signed distance field (= value of each texel is distance to ...
• 4,910
1 vote
694 views

### Collision detection using distance field for a dynamic object

I am using a signed distance field for collision detection. The object I calculated the distance field for rotates between 0 and -30 degrees. The other object I want to check collision against is in a ...
1k views

### How to calculate the viewing cone radius at a distance in raymarching?

I'm "raymarching distance fields" (proper lingo: sphere-tracing) in GLSL. To implement cone-marching atop of it (and also to minimize the number of raymarching steps regardless of whether cone-...
• 203
13k views

### How can I generate signed distance fields (2D) in real time, fast?

In a previous question, it was suggested that signed distance fields can be precomputed, loaded at runtime and then used from there. For reasons I will explain at the end of this question (for people ...
• 4,392