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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user