fx notes

Search

Search IconIcon to open search

Volumes

Last updated Jan 5, 2024 Edit Source

# Inefficient Volumes

The following are my personal notes on Lewis Taylor’s fantastic SYDHUG Talk. Definitely worth watching! There is also a download link for all the demo scenes in the video description.

# Impacts of Inefficient Volumes

# How to reduce Volumetric Data

# Frustum Volumes

Instead of orienting voxels along the xyz axis the camera frustum is used to rasterize the voxels to the cameras 2D plane x and y axis as well as the z depth.

# PROS
# CONS

# Volume Compression

“it really really adds up”

Lewis compared 3 vdbs:

  1. uncompressed 32 bit no field culling no field resampling 34 mb

  2. compressed but still cartesian 16 bit field culling - vel field resample - 2x vel 3.2 mb

  3. compressed + frustum cull 16 bit field culling - vel frustum cull in sim field resample - 2x vel 1.8 mb

# Other Useful Information

# How many Voxels do you need per Pixel?

Usually you are good to go with 1/2.5 voxels per pixel.

# Frustum Rasterizing vs Frustum Culling SOPs vs Frustum Culling DOPs
  1. Rasterizing

You need the VDB Rasterize Frustum SOP and a camera frustum VDB.

  1. Culling SOPs

If you just want to cut off anything outside the cameras frustum you can use the VDB Clip SOP.

  1. Culling DOPs

To cull right inside the simulation you can use the following snippet inside a Gas Field Wrangle node piped into the advection output of the pyro solver.

// gas field wrangle

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
// by Lewis Taylor

string cam = chsop("cam");
vector ndcP = toNDC(cam,@P);
//vector camP = ptransform("space:camera",@P); //non perspective space if needed

float mult = 1;

if(chi('cull_x_negative')) mult *= ndcP.x > -ch('cam_x_neg') ;
if(chi('cull_x_positive')) mult *= ndcP.x < 1 + ch('cam_x_pos') ;
if(chi('cull_y_negative')) mult *= ndcP.y > -ch('cam_y_neg') ;
if(chi('cull_y_positive')) mult *= ndcP.y < 1 + ch('cam_y_pos') ;
if(chi('cull_z_negative')) mult *= ndcP.z < ch('cam_z_neg') ;
if(chi('cull_z_positive')) mult *= ndcP.z > -ch('cam_z_pos') ;


//foreach( int i; string field; split(chs('fields'))){} //maybe loop over given fields, usually density is enough
f@density *= mult;
f@temperature *= mult;
f@flame *= mult;
@Cd *= mult;

sources / further reading:


Interactive Graph