Questions tagged [signed-distance-field]

An SDF is a function which takes a position as an input, and outputs the distance from that position to the nearest part of a shape.

Filter by
Sorted by
Tagged with
53 votes
5 answers
24k views

Sharp Corners with Signed Distance Fields Fonts

Signed Distance Fields (SDFs) was presented as a fast solution to achieve resolution independent font rendering by Valve in this paper. I already have the Valve solution working but I'd like to ...
user avatar
  • 1,156
13 votes
1 answer
1k views

Is Jump Flood Algorithm Separable?

JFA (the algorithm described here: http://www.comp.nus.edu.sg/~tants/jfa/i3d06.pdf) can be used to get an approximation of a Voronoi diagram, or a distance transform. It does so in logarithmic time ...
user avatar
  • 7,351
10 votes
0 answers
304 views

Choosing width of data for signed distance field texture

A signed distance field texture is a technique where you store the distance from a pixel to the surface of a shape within the color information for that pixel, allowing almost vector graphics quality ...
user avatar
  • 7,351
9 votes
1 answer
1k views

Asset creation for signed distance field rendering?

In traditional computer graphics, most 3D models are rendered by rasterizing or ray tracing against a subdivided mesh of primitives, usually triangles or quads. More recently, some real-time ...
user avatar
  • 1,074
6 votes
1 answer
1k views

Signed distance field font looks odd

I attempted to implement font rendering using signed distance fields. My program first generates a mono bitmap at font size 64 (using FreeType), then generates an SDF from the bitmap. This is then ...
user avatar
  • 163
4 votes
1 answer
1k views

GLSL shapes signed distance field implementation explanation?

I'm trying to understand all primitives In this article.After hard work I just learn Sphere and Cube , I wrote description here. I could draw 2D shapes but I have trouble understanding 3D below codes:...
user avatar
4 votes
2 answers
810 views

MipMaps for Signed Distance Field

Is there some algorithm that keeps details when creating mipMaps for SDF? For example group of 4 pixels when only one is above threshold will lose this pixel with bilinear and creating mipMaps with '...
user avatar
  • 556
3 votes
3 answers
4k views

How can I get a signed distance (SDF) from a mesh?

I am trying to use constructive solid geometry (CSG) and boolean operators to combine various shapes and get the outer (possibly concave) hull. This seems to work okay when using primitive shapes like ...
user avatar
3 votes
0 answers
239 views

Merging/Clipping Signed Distance Fields

I have multiple separate shapes for which I have generated signed distance fields by merging and clipping them against each other. Is there a generic analytical solution for merge and clip operations ...
user avatar
  • 131
2 votes
1 answer
158 views

Having trouble implementing distance transform with jump flood

I'm attempting to use the jump flood algorithm to compute distance transforms of an arbitrary texture derived from a canvas2d context, roughly following the explanations detailed here/here. In the ...
user avatar
  • 23
1 vote
1 answer
598 views

How to scale signed distance field fonts properly?

I have a setup where I'm rendering a bunch of characters on a canvas with an SDF font. The users can zoom in to see the details of the smaller texts, but currently the smaller characters are quite ...
user avatar
  • 121
1 vote
1 answer
469 views

SDF collision detection

I was wondering if there are any techniques for calculating the intersection point/s between two or more distance fields.
user avatar
1 vote
0 answers
22 views

Distance to arbitrary set of line segments acceleration structure?

Background: I'm trying to render lightning within a volumetrically rendered cloud. I'm currently using a series of line-segments to represent lightning. At first I used a distance field rendered into ...
user avatar
  • 280
1 vote
0 answers
189 views

Combine box shadow with a signed distance field

I'm using 2d signed distance fields in my current project for drawing shapes (example: https://www.shadertoy.com/view/4llXD7) and I want to add drop shadows to them. At first I thought I could exploit ...
user avatar
  • 111
0 votes
2 answers
163 views

How to avoid curvature artifact in raytracer?

I have a pretty simple raytracer that is rendering some SDFs, but when my camera is close to the object I see curves: I am not entirely sure where they are coming from, as I am using nothing but ...
user avatar
  • 1,449
0 votes
1 answer
59 views

Closest sphere on segment

I am trying to get a segment closest point on a surface and display a circle (or sphere in this case) at that position. I actually get the correct position but I can't get a uniform sphere based on ...
user avatar
  • 1,169
0 votes
0 answers
32 views

Getting something close to the convex full of SDFs using CSG operations

Inigo Quilez has an explanation of smooth operations to join sdfs. I am trying to get something close to the convex hull of multiple sdfs. For starters let;s consider a simple case of 3 cubes int eh ...
user avatar
  • 1,449
0 votes
0 answers
24 views

Can you estimate the shadow in a plane of an SDF?

I have an SDF and a plane. I want to generate either a square or a circle on the plane such that the orthogonal projection of the sdf on the plane (i.e. its orthogonal shadow) is guaranteed to be ...
user avatar
  • 1,449
0 votes
0 answers
29 views

Explanation for the brute force ray marching method

Hellos, I am new to raymarching and 3D and I use python for my coding. I am trying to make a engine for raymarching and was finding the signed distance function for a mesh. How can I get a signed ...
user avatar
0 votes
0 answers
31 views

Improving dual contouring convergence

I have my own implementation of dual contouring. Right now I am getting the following output: This is decent, but I am trying to get a better result (i.e. try to reduce the low level voxel noise as ...
user avatar
  • 1,449
0 votes
0 answers
57 views

Mathematical foundations of Signed Distance Fields in computer graphics

I have come across Signed Distance Field usage in Computer Graphics in construction of vector shapes, glyphs and 3D surfaces. However I can not find much of the background mathematical theory as to ...
user avatar
0 votes
0 answers
25 views

obj to grd sdf generators?

I am trying to generate sdfs from objs but when I try to use the only tool I find online it segfaults on even the simplest inputs, such as the blender cube. Does anyone know of a tool to generate grid ...
user avatar
  • 1,449
0 votes
1 answer
363 views

Ray-Marching: Rendering a Voxel Grid with Proper Normals

Dear Computer Graphics SE, I have a RAYMARCHING renderer, that looks up voxel data from a 3D texture. Each cell in the texture can be 0 or 1. I have a very simple algorithm for calculating the signed ...
user avatar
0 votes
0 answers
36 views

Good rectangular covering of an SDF

Perhaps this is more computational geometry, but here goes: I have a 2D SDF describing my shape, but it's fine to think of it as a black/white image (black="inside" white="outside")...
user avatar
  • 133
0 votes
0 answers
58 views

GPU accelerated 2D graphics library with signed distance functions

I want to create my own 2D graphics library using signed distance functions where everything is drawn on the GPU. Browsing the web I quickly found Inigo Quilez website that describes how to draw basic ...
user avatar
  • 101