Rendering of sphere with texture and reflections
Rendering of sphere with texture and reflections

Java Raymarcher

2023

Technologies
Java
Description
A raymarching rendering engine written in Java.

What is raymarching?

In short, raymarching is a rendering technique where rays are iteratively marched through a scene, with step size being determined by functions called SDFs.

SDF stands for signed distance function, and it is simply a function defined for a shape that takes in a point, and returns the distance between the shape and the point.

For example, a sphere has an SDF of:

float sphereSDF(vec3 point, Sphere s) {
    return length(s.center() - point) - s.radius();
}

Why is this significant?

Using a raymarching algorithm, any shape that has an SDF can be rendered. This means that certain scenes or objects that would normally be difficult to model with regular meshes can be rendered with minimal extra cost.

Raymarched Fractal Credit: Leslie Stowe