Page MenuHome

Eevee: internal support for arbitrary number of volume grids
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Feb 27 2020, 6:24 PM.

Details

Summary

This has no user visible impact yet since smoke volumes only support a fixed
set of attributes, but will become important with the new volume object.

For GPU shader compilation, volume grids are now handled separately from
image textures. They are somewhere between an attribute and a texture, being
basically an attribute that is stored as a texture.

Diff Detail

Repository
rB Blender

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Mar 11 2020, 3:05 PM
This revision was automatically updated to reflect the committed changes.

To make sure I unerstand. This patch adds support for arbitrary number of volume DATA. you still have only one grid.

I was under the impression we could have multiple volume subobjects inside the same object.

I think GPU_volume_data could be better than GPU_volume_grid.

source/blender/gpu/intern/gpu_material.c
671

i believe this has to also be persent in some way inside the options in order to fetch the right shader in GPU_material_from_nodetree_find.
It is not obvious to me this is the currently the case.

Brecht Van Lommel (brecht) marked an inline comment as done.Mar 11 2020, 4:00 PM

To make sure I unerstand. This patch adds support for arbitrary number of volume DATA. you still have only one grid.

Before this, there were 3 hardcoded grid types: density, color and temperature. Each would have its own 3D texture. Now there can be an arbitrary amount with arbitrary names.

I'm not sure what your definition of volume data and volume grid is.

I was under the impression we could have multiple volume subobjects inside the same object.

I don't see how this is possible. There can be only one fluid simulation per object, at least there is no way that multiple would render correctly.

I think GPU_volume_data could be better than GPU_volume_grid.

This is the terminology we use for the new volume object and the same one that is used in OpenVDB, Houdini, etc. A .vdb file contains a list of OpenVDB grids.

source/blender/gpu/intern/gpu_material.c
671

Eevee already sets distinct options for surfaces and volumes, but these option flags are defined in the Eevee code and not accessible outside of it. GPU_material_from_nodetree_find works the same as before.

What it does is make this information available to shader nodes so they know if compilation is being done for a surface or volume shader.

This is the terminology we use for the new volume object and the same one that is used in OpenVDB, Houdini, etc. A .vdb file contains a list of OpenVDB grids.

Then so be it. I have no issue with the patch.