Hello
What is the proper way to fill data of a volume attribute for rendering? I am not using the Blender, but try to create custom application for rendering some volumetric data where Cycles used as the render engine. I try to use the same code as in blender_mesh.cpp:
Attribute *attr = mesh->attributes.add(ATTR_STD_VOLUME_DENSITY);
VoxelAttribute *volume_data = attr->data_voxel();
and next I should add data to the volume attribute by using
volume_data->slot = scene->image_manager->add_image(…)
All parameters of the method add_image are clear except the second one: void *builtin_data. As I understand this parameter is the pointer to some data structure with all necessary information of voxels (dimensions, channels and so on). So, the question: how I should create this structure? May be there are some examples, or fragments of source code, where the similar stuff is implemented?