06.12 · 3D & Advanced

Ray Marching / SDF Scene

A 3D scene drawn only from formulas, circled by a camera. Best for art pages.

Watch it

It moves by itself. Pause it to look closely, or turn on slow motion to see each part of the movement.

Try it

Change a setting and see the difference as it moves.

Scene

Shapes that melt, shapes cut from shapes, or endless copies.

Camera speed

How fast the camera circles the shapes.

Real soft shadows; costly, so best left off on phones.

More optionsFewer options

Darkens creases where surfaces meet.

Detail

More steps find thin edges; phones use fewer.

Colors each pixel by how many steps it took.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a ray-marched 3D scene to [the section you want it in]. Draw the whole scene in a fragment shader, with no 3D models: describe each shape as a formula that gives the distance to its surface, then for every pixel step a ray forward by that distance until it touches a surface, and light that point. Formulas let shapes melt together, be carved out of each other or repeat without end, while a camera circles them. Every pixel does a lot of work, so draw fewer pixels and take fewer steps on phones. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Art pages
  • Hero visuals
  • Tech demos

Avoid on

  • Behind text
  • Low-power devices