Cycles code internals: add support for mesh voxel grid attributes.

These are internally stored as a 3D image textures, but accessible like e.g.
UV coordinates though the attribute node and getattribute().

This is convenient for rendering e.g. smoke objects where data like density is
really a property of the mesh, and it avoids having to specify the smoke object
in a texture node, instead the material will work with any smoke domain.
This commit is contained in:
Brecht Van Lommel
2014-03-29 13:03:48 +01:00
parent 393216a6df
commit 27043b8e40
13 changed files with 258 additions and 117 deletions

View File

@@ -768,9 +768,7 @@ bool OSLRenderServices::get_attribute(void *renderstate, bool derivatives, ustri
if (attr.elem != ATTR_ELEMENT_OBJECT) {
/* triangle and vertex attributes */
if (prim != PRIM_NONE)
return get_mesh_element_attribute(kg, sd, attr, type, derivatives, val);
else
if(!get_mesh_element_attribute(kg, sd, attr, type, derivatives, val))
return get_mesh_attribute(kg, sd, attr, type, derivatives, val);
}
else {