From 4403ca80bda690c0ac44e4a6db0cddf4b2428006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Thu, 22 Feb 2018 16:26:50 +0100 Subject: Smoke: expose empty space clipping property to the UI. This is used to determine which voxels are to be considered empty space. Previously it was hardcoded for converting dense grids to OpenVDB grids to reduce disk space usage. This value is also useful for rendering engines to know, i.e. to optimize ray marching. --- intern/openvdb/openvdb_capi.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'intern/openvdb/openvdb_capi.cc') diff --git a/intern/openvdb/openvdb_capi.cc b/intern/openvdb/openvdb_capi.cc index ef4f8c8820f..1c8b51a23c4 100644 --- a/intern/openvdb/openvdb_capi.cc +++ b/intern/openvdb/openvdb_capi.cc @@ -39,7 +39,7 @@ int OpenVDB_getVersionHex() OpenVDBFloatGrid *OpenVDB_export_grid_fl( OpenVDBWriter *writer, const char *name, float *data, - const int res[3], float matrix[4][4], + const int res[3], float matrix[4][4], const float clipping, OpenVDBFloatGrid *mask) { Timer(__func__); @@ -53,6 +53,7 @@ OpenVDBFloatGrid *OpenVDB_export_grid_fl( data, res, matrix, + clipping, mask_grid); return reinterpret_cast(grid); @@ -61,7 +62,7 @@ OpenVDBFloatGrid *OpenVDB_export_grid_fl( OpenVDBIntGrid *OpenVDB_export_grid_ch( OpenVDBWriter *writer, const char *name, unsigned char *data, - const int res[3], float matrix[4][4], + const int res[3], float matrix[4][4], const float clipping, OpenVDBFloatGrid *mask) { Timer(__func__); @@ -76,17 +77,17 @@ OpenVDBIntGrid *OpenVDB_export_grid_ch( data, res, matrix, + clipping, mask_grid); return reinterpret_cast(grid); } -OpenVDBVectorGrid *OpenVDB_export_grid_vec( - struct OpenVDBWriter *writer, - const char *name, - const float *data_x, const float *data_y, const float *data_z, - const int res[3], float matrix[4][4], short vec_type, - const bool is_color, OpenVDBFloatGrid *mask) +OpenVDBVectorGrid *OpenVDB_export_grid_vec(struct OpenVDBWriter *writer, + const char *name, + const float *data_x, const float *data_y, const float *data_z, + const int res[3], float matrix[4][4], short vec_type, const float clipping, + const bool is_color, OpenVDBFloatGrid *mask) { Timer(__func__); @@ -105,6 +106,7 @@ OpenVDBVectorGrid *OpenVDB_export_grid_vec( matrix, static_cast(vec_type), is_color, + clipping, mask_grid); return reinterpret_cast(grid); -- cgit v1.2.3