Skip to content

cecarlsen/SDFTextureGenerator

Repository files navigation

SDF Texture Generator

Signed Distance Field (SDF) texture generator for Unity using the Jump Flooding Algorithm (JFA) implemented in a ComputeShader.

Updated with Unity 6000.3.0f1.

There are two main procedures in this repo:

  • MaskToSdfTextureProcedure (pixels).
  • Mask3DToSdfTexture3DProcedure (voxels).

Splash

Implementation notes

  • Using a single texture to store both inside and outside seeds, reducing the number of dispatch calls and texture R/W.
  • Using GPU group shared memory to reduce reads per thread.
  • Optional sub pixel interpolation for smoother edges, especially at low resolutions.
  • Optional downsampling.
  • Optional double buffering to remove jitter (GPU race conditions).
  • Optional SDF and internal flood texture precision settings.

Splash

References

About

Signed Distance Field (SDF) texture generator for Unity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors