8/12/2020 - 8/18/2020

Node Institute

TouchDesigner, GLSL, Blender, Substance Painter

volumetrics in TouchDesigner by Lucas Morgan

Node Institute

Summary

Learn how to build a custom volumetric lighting system in TouchDesigner from Lucas Morgan, the creator of GeoPix.
It became apparent to me after nearly half a year researching volumetrics and implementing it via shaders in GeoPix that the TouchDesigner community had no visible and clear body of work that could help them achieve these types of results themselves.

I saw this as an opportunity to package up what I had learned and taught myself, and further refine my understanding of it by putting it into a teachable format and making it available through The Node Institute.

Scene setup & PBR materials

The first video in the series focused covering the pre requisites and supplied data for the course. I went over the mesh, the PBR material, Substance Painter, Blender, and what we were trying to accomplish with the TouchDesigner patch.
substance painter workflowVolumetrics in TouchDesigner network backend

Linear color workflow

One important technical rule about compositing and lighting math in GLSL is that the calculations must be done in linear space. This is a non intuitive thing to those who are not traditionally lighting or visual programmers, or who are not trained in computer animation related fields.

The conversation about gamma, monitors, human sight, and industry best practices is a deep and long one that I won't got too deep into here, but I have written a few pieces for the TouchDesigner community specifically to try and bring some attention to these important workflows when photo realism is a goal.

Raymarching

Raymarching is at the core of volumetric rendering and many other GLSL effects. A bit further into the course, I began outlining the basics of Raymarching in a 2D visual interactive example, then next we dove into the code. I use Nvidia Nsight Graphics to reverse engineer some shaders in order to create our own, that meshes elegantly into TouchDesigner's lighting model.

Raymarching diagramNvidia Nsight graphics to dissect shader codebeachball looking image representing raymarch vectorsstepped volumetricsinterpolating raymarched volumetrics with Blue Noise

Use cases for Volumetrics

The obvious use case for volumetrics are to simulate a beam a light, such as a theatrical light, or a spot light, etc. However there are actually many more uses for volumetrics, that tend to be more subtle, but very powerful when it comes to selling a scene's believability and realism.

Underwater scenes can be simulated with volumetrics, haze, and overcast days. Even the most subtle of volume can tie elements of a scene together nicely, selling depth and scale much more believably.

under water scene with fish using volumetric raymarching TouchDesignera cyberpunk scene with volumetric lighting

You can of course do abstract and whacky stuff too! Sometimes those are the most fun of all.

a fun scene with a space man playing a saxaphone