Viking on a Path

This entire scene is essentially one big equation, rendered using a single fragment shader. The vertex shader simply returns a quad that fills the entire viewport. Instead of using polygon meshes to represent shapes, it uses Constructive Solid Geometry (CSG) to produce signed-distance fields (SDFs) of implicit surfaces, which are then raymarched to produce a render of the scene.

There are no "assets", the models and textures are all done procedurally in the shader. The main character is just a series of geometric primitives added and blended together, with various distortions and space warping to further shape them, and transforms applied at key points for animation.

The landscape is the signed-distance to a plane, with several octaves of sine noise applied, and a smoothstep to keep said noise off the cobbled path. The path texture is just sampling a voronoi noise function. The grass is also voronoi, extruded.

I had a ton of fun working on this because it was my first serious attempt at SDF rendering, which I've been wanting to tinker with for a while. I'm hooked. I'd really like to apply this to an actual game, because implicit surfaces give you so many things for free that are really difficult with traditional modeling techniques. Collision with the terrain was just sampling the terrain's SDF at the player's position.

For future scenes I'd like to develop art tools that allow me to construct the geometry, textures, and animations, rather than simply typing equations directly into the shader.

I'd like to push things *much* further next time, with more intricate characters/rigs and more expressive animation.

Room for Improvement

  • texture filtering and multi-sampling
  • more detail on the "wood grain" of the shield
  • reflections on metallic surfaces
  • optimizing bounding volumes and duplicate operations for better performance, shorter compilation
  • adding a sun, volumetric clouds, day-night cycle, stars