Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/image_vdb.cpp
| Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | # endif | ||||
| Transform index_to_object; | Transform index_to_object; | ||||
| for (int col = 0; col < 4; col++) { | for (int col = 0; col < 4; col++) { | ||||
| for (int row = 0; row < 3; row++) { | for (int row = 0; row < 3; row++) { | ||||
| index_to_object[row][col] = (float)grid_matrix[col][row]; | index_to_object[row][col] = (float)grid_matrix[col][row]; | ||||
| } | } | ||||
| } | } | ||||
| # ifdef WITH_NANOVDB | # ifdef WITH_NANOVDB | ||||
| /* Add small offset for correct sampling between voxels. */ | Transform texture_to_index = transform_identity(); | ||||
| Transform texture_to_index = transform_translate(0.5f, 0.5f, 0.5f); | |||||
| # else | # else | ||||
| Transform texture_to_index = transform_translate(min.x(), min.y(), min.z()) * | Transform texture_to_index = transform_translate(min.x(), min.y(), min.z()) * | ||||
| transform_scale(dim.x(), dim.y(), dim.z()); | transform_scale(dim.x(), dim.y(), dim.z()); | ||||
| # endif | # endif | ||||
| metadata.transform_3d = transform_inverse(index_to_object * texture_to_index); | metadata.transform_3d = transform_inverse(index_to_object * texture_to_index); | ||||
| metadata.use_transform_3d = true; | metadata.use_transform_3d = true; | ||||
| ▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines | |||||