/CurvatureDirectedRendering

Curvature-directed lines for conveying the shape of 3D SDF surfaces in a perceptually optimal manner

Primary LanguageHLSLMIT LicenseMIT

CurvatureDirectedRendering

Demo Scene

About

Curvature-directed lines for conveying the shape of 3D SDF surfaces in a perceptually optimal manner, modernized to run in real time on the GPU.

Features

  • Principal direction/curvature derivations for SDFs
  • Parallel Poisson disk point sampling across SDF surfaces on the GPU
  • Procedural geometry generation with compute shaders

Demo

A demonstration of this technique applied to the Stanford Bunny is available in the Demo scene in the Assets/Scenes folder, which can be accessed by downloading this repository and opening with Unity 2022.3 or later.

To experiment with the demo, press play in the Demo scene and adjust the various sliders in the top left corner to alter the visualization in real time.

There are three additional toggles in the top right corner that are meant to be left on, but can be toggled off to demonstrate how their associated features are necessary in maximizing the perceptual effectiveness of the technique. They are as follows:

  • Taper: Whether or not to taper the lines. Creates softer, more visually appealing lines.

Taper     No Taper

  • Scale by Curvature: Whether or not to scale the length and width of lines by the value of first principal curvature. Essential for conveying the shape of the object.

Scale by Curvature     Constant Scale

  • Poisson Disk Sampling: Whether or not to use poisson disk sampling to generate the initial starting points for the lines. Necessary to avoid overlapping lines and inconsistent empty space.

Poisson Disk Sampling     Random Sampling

Usage

This is a general technique that can be applied to the rendering of any 3D SDF surface. To apply this technique to an SDF of your own, simply use the CurvatureRenderer.cs class as demonstrated in the Demo scene.

Credit

The technique presented here is a modernization of Victoria Interrante's excellent research on illustrating surface shape with curvature:

The GPU poisson disk sampling algorithm used is an interpretation of the technique described in the following paper:

The SDF for the Stanford Bunny was generated using the following python package: