Isotropix Forums

Bake lighting into a VDB

General Discussion about Isotropix and CG related topics

Bake lighting into a VDB

Unread postby bvz2000 » Tue Aug 21, 2018 6:57 pm

I am pretty sure this is impossible, but I am posting it here so that:

a) I can find out for sure

and

b) See if anyone thinks this would be a good idea.


We have a volume heavy show with tons of VDB's being rendered (think animated cameras rendering 7K frames with nearly every pixel encompassing at least one if not more VDB's). This is incredibly heavy and we are looking for every trick in the book to speed up our renders.

What I would like to do is to bake the lighting from clarisse into the VDB's. In other words, each voxel would store an RGB intensity value that would be supplied by Clarisse and be a combination of all the intensities of all the lights at that voxel. These VDB's would then be written out to disk.

Subsequently, the final render pass would forgo lighting the VDB's alltogether, but instead use the stored intensity value when rendering. Obviously the ray still needs to march through the VDB and use the density values to control the contribution of each voxel, but if my tests rendering unlit VDB's (as holdout objects) are relevant, we would see a massive speedup in our renders.

What do you think? Is something like this possible? Could it be coded by an end user if necessary? Would it actually provide us with much of a performance improvement?

Thanks!
bvz2000
 
Posts: 416
Joined: Thu Nov 13, 2014 6:05 pm

Re: Bake lighting into a VDB

Unread postby pulverfass » Tue Aug 21, 2018 8:06 pm

There are some nodes and techniques in Houdini to do this rather easily, but then you dont have the Clarisse lighting. We experimented with getting baked volumes into Maya with Arnold in our case via Houdini. It did work, but matching the light to the other DCCs Scene was difficult, so we ended up rendering the volumes at half res, since it was only night shots and a lot of movement.
Another option may be OpenGl rendering the clouds in Houdini, since that is rather fast, and with the right settings it looks pretty damn good.
If there was a way to speed up volumes in Clarisse, that would be amazing!
pulverfass
 
Posts: 30
Joined: Mon Mar 05, 2018 1:10 pm

Re: Bake lighting into a VDB

Unread postby bvz2000 » Wed Aug 22, 2018 12:49 am

Thanks for the reply.

We considered trying it in Houdini, but of course ran into the same issues you described. Plus, over 80% of these shots are volumes, so most of the scene is actually being lit in Clarisse. I suppose we could try moving everything into Houdini, but that would be a massive change in the middle of our production.

Did the baked VDB's render faster? That is my biggest question as to this technique. Also, I am not sure how we would shade them. Do an extract property of the intensity, but then plug that into the emission slot of the volume shader?

Ultimately, though, this would be a tough thing to implement simply because we would need a custom VDB for each location in a scene (we are instancing the VDB's currently). That might be enough of a hurdle that the whole idea makes no sense anymore.
bvz2000
 
Posts: 416
Joined: Thu Nov 13, 2014 6:05 pm

Re: Bake lighting into a VDB

Unread postby isoyann » Wed Aug 22, 2018 10:01 am

Currently, this is impossible... but yes it make sense, and would be usefull in specific cases. Writing to vdb can be usefull for many other things too (writing particle clouds for example). I've added a feature request (#8645)

Thanks!
User avatar
isoyann
 
Posts: 640
Joined: Mon Jan 28, 2013 11:11 am

Re: Bake lighting into a VDB

Unread postby mdkai » Wed Aug 22, 2018 6:25 pm

Hi
I have my doubts about speeding up by baking ..vdbs if used as volume are more dependent on the density since pathtracer rely on the principle of transfer on, through and scatter with any element, volumes are the worst case as soon as the ray enters the medium. A volume is needing 4x more sampling to compensate the noise equal to surfaces.

So the more deep but transparent, the worse...thick dark smoke for example is much easier to render than soft clouds.

So in terms of how to approach your scene ..first depends on the type of volume that needs to be depicted and other factors ..
- Is the camera going through or along the volume ?
- are there multiple distances or LODs possible ?
- is the medium thick or thin ?
- is it animated as a sequence or static
- how will the result be lit , strong lit from a few or by a overall overcast sky type...

In general volume passes benefit when used with deepexr but for 7k res shot thats quite a challenge to handle with nuke ...

Try to find groups/areas and create LOD kind of vdbs, as long as you are more far away you can do a lot with extra noise for detail.
Add a pass where the volume is shaded based on a pworld color input or a linear gradient with rgb values ...it helps to pick areas.
Fortunately Clarisse can even use cryptomatte with volumes.

Consider a way of clipping /culling away areas outside of the frustrum of the camera ..but be mindful to not go to tight or the difference will be visible at the image boundary.

Alternatives can be used with lots of particles , but for volumes that has to come from another package as Clarisse can not scatter particles based on Vdbs (yet?)

Also you may want to consider a polybased approach which you convert to a volume in Clarisse..

Cheers
Kai
Join us at the Discord https://discord.gg/G5cJj9A
mdkai
 
Posts: 325
Joined: Tue Oct 07, 2014 7:24 pm

Re: Bake lighting into a VDB

Unread postby ambassador1 » Sat Aug 25, 2018 2:00 am

I think its getting over complicated. Ran a little test while on the road.

Just render your lit volumes quarter or less res, low quality, with hold outs or what have you as needed. UpRes, denoise, frame blend, proMist, then reProject from cam with no lights, crank render settings way down. You still get deep, alpha and all that. Again, quick dirty test with just some denoise in PS. 2k x 2k took 20 seconds on my laptop. Original volume render 400x400, cbb.
Attachments
cloud.jpg
ambassador1
 
Posts: 248
Joined: Mon Dec 15, 2014 11:40 pm

Re: Bake lighting into a VDB

Unread postby bvz2000 » Sat Aug 25, 2018 2:37 am

Ha! That's great. I was just testing something similar :) We were projecting painted images onto the clouds and getting some nice results.

That is a good Idea. I'll put it together on Monday.
bvz2000
 
Posts: 416
Joined: Thu Nov 13, 2014 6:05 pm


Return to General Discussion