Real-time ray-marched 3D Volumetrics in TouchDesigner (online course)

Hey folks! If you haven’t seen, or aren’t tuned into the facebook world as much - here’s a link to my online course over at the NODE Institute for creating realtime volumetrics in Touch :slight_smile:
Volumetrics in TouchDesigner

This method I teach leverages light COMP’s and the existing TouchDesigner lighting framework very heavily, so it reduces the amount of glsl code you have to write generally when doing work like this and also makes your pbr renders really fit together tightly with your volumetrics.

The other big plus here is that since lighting effects are usually composited as a simple add, this is a very modular pass, you could package it up as a tox with some work and have it in the palette to drop in for fairly quick volumetrics.

Here’s a few examples and stills from a few different scenes I put together using this technique:



6 Likes

@lucasm Lucas, I’ve been really enjoying this course, it’s very well laid out. I’m learning a lot about how TD is handling some of this stuff under the hood, and having just dug into the @raganmd deferred lighting investigation, this seems like a great progression for getting the most out of TD’s lighting.

I do have an issue I’d love to hear your insights on. After spending longer than I’d care to admit trying to figure out why I couldn’t Nsight shader snoop the iTDCalculateLightPBR0 function I was looking for, I realized I had made the classic mistake of starting the tutorial in the experimental build, and after recreating my PBRs in the latest stable yeilded the same results you are getting in your PBR video. This leads me to believe that changes made to the PBR material(shadow and world space data according to the release notes) might mean a different approach to dissecting the PBR shader moving forward.

Have you worked with the new experimental at all? If you Output shader on a PBR in this latest build, let me know if you’re getting useful info from the iTDCalculateLightPBR0 function, or if it seems like there are different ways that we might have to approach this in the near future.

Thanks for sharing this stuff, I’m glad someone is really investigating these things, and disseminating the info

Awesome thank you! Glad to hear you’re finding some of the secondary info valuable too. I wanted to pack in as much of that other stuff as I could, it really comes in handy in other areas of learning.

I haven’t tried out this workflow on the latest experimental until just now, but I was able to extract a very similar looking function called iTDCalculateLightPBR0(). I’m on the latest experimental 2020.41040.

For me, the second FS entry in one of the shaders:
image

yielded a function named similarly, but returns an object called TDPBRResult:
image

The workflow would change very slightly at the very least for the newest experimental, due to TDPBRResult, however you should still be finding the bulk of that lighting function somewhere in there.

I’ve attached a simple scene that for me, in the latest experimental yields the lighting function in Nsight. Does this have any dissimilarities from yours?

I’ll update the course description with TD version for future course attendees.
pbr_Nsight_template.1.toe (5.2 KB)

Any thoughts on applying these techniques to replicate an emissive panel? I guess I’m trying to figure out a way to project the volumetric light/projection map orthographically from the perspective of an arbitrarily sized quad placed within the volume. Let me know if this is something you’ve put any thought into

1 Like

I’ve actually put quite a bit of time into researching what’s out there currently for this. It’s next on my list to implement into TD… but for the mean time here’s some good reading materials if you feel like diving in asap :slight_smile:

The main search query to throw at google is LTC area lights:

some glsl demo’s:
https://blog.selfshadow.com/sandbox/ltc.html
https://www.shadertoy.com/view/wlGSDK

reading:



1 Like

Haha, I knew that was a rhetorical question

:smiley: I’ve definitely fallen down a rabbit hole the last year almost now with lighting pipeline stuffs.

Also, something else you might find interesting that I literally just stumbled on last week but has been a thing for a little is screen space global illumination or SSGI.



screen space effects are less accurate as they don’t know what exists beyond the camera’s view and have weird edge cases more often, but usually a fixed cost vs actual lighting functions which have to be looped for every light etc.

Do you tend to use SSAO or any depth blurring in this kind of pipeline?

Not yet! I def want to implement DOF, I’ve also been curious to implement some types of SSAO and see if anything newer / faster exists out there than the built in one. Honestly haven’t had too much time to look yet.

1 Like

@lucasm Hey Lucas :slight_smile: I was poking around for screen space reflections in TD and found this guys stuff: https://github.com/yasuhirohoshino/TouchDesigner_PostEffects

You’ll find a nice DoF effect, a nicer AND faster SSAO than TD, and 3 versions of SSR too (basic, less basic, and pbr).

//Philippe F4

3 Likes

Whoaa! have not stumbled across that. Diving in soon, especially on the ssr and ssao! thanks for the link Philippe :slight_smile: that is awesome.

1 Like