[Bf-blender-cvs] [e08ae99652b] fluid-mantaflow: Merge branch 'master' into fluid-mantaflow
Sebastián Barschkis
noreply at git.blender.org
Thu Jul 18 23:55:34 CEST 2019
Commit: e08ae99652b2665f2d2e900bd20e7f6646f331a7
Author: Sebastián Barschkis
Date: Thu Jul 18 22:20:20 2019 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBe08ae99652b2665f2d2e900bd20e7f6646f331a7
Merge branch 'master' into fluid-mantaflow
===================================================================
===================================================================
diff --cc release/datafiles/locale
index 2b81e2acc01,0f771b0f380..6625026f62f
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit 2b81e2acc011a8b79232a18dad3c00b8e654ceee
-Subproject commit 0f771b0f380a1ae21d859416043c6119f66e40c9
++Subproject commit 6625026f62f492dd677f5f29c68b9d70c96fb34b
diff --cc release/scripts/addons_contrib
index fe37465a84f,0aa23a4d617..b4fce25e94e
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit fe37465a84fdcadcb0465888d58bed2f87c36ce5
-Subproject commit 0aa23a4d6177bed4c12392c81d0b767a8b35fe61
++Subproject commit b4fce25e94ec139554e821f58bbada3384b13afa
diff --cc source/blender/draw/engines/workbench/workbench_volume.c
index d17ec80adf5,575da1f9683..cacb5927307
--- a/source/blender/draw/engines/workbench/workbench_volume.c
+++ b/source/blender/draw/engines/workbench/workbench_volume.c
@@@ -153,11 -154,11 +153,11 @@@ void workbench_volume_cache_populate(WO
if (use_slice) {
float invviewmat[4][4];
- DRW_viewport_matrix_get(invviewmat, DRW_MAT_VIEWINV);
+ DRW_view_viewmat_get(NULL, invviewmat, true);
- const int axis = (sds->slice_axis == SLICE_AXIS_AUTO) ?
+ const int axis = (mds->slice_axis == SLICE_AXIS_AUTO) ?
axis_dominant_v3_single(invviewmat[2]) :
- sds->slice_axis - 1;
+ mds->slice_axis - 1;
float dim[3];
BKE_object_dimensions_get(ob, dim);
/* 0.05f to acheive somewhat the same opacity as the full view. */
@@@ -195,28 -196,28 +195,28 @@@
}
else {
static float white[3] = {1.0f, 1.0f, 1.0f};
- bool use_constant_color = ((sds->active_fields & SM_ACTIVE_COLORS) == 0 &&
- (sds->active_fields & SM_ACTIVE_COLOR_SET) != 0);
- DRW_shgroup_uniform_texture(grp, "densityTexture", sds->tex);
- DRW_shgroup_uniform_texture(grp, "shadowTexture", sds->tex_shadow);
+ bool use_constant_color = ((mds->active_fields & FLUID_DOMAIN_ACTIVE_COLORS) == 0 &&
+ (mds->active_fields & FLUID_DOMAIN_ACTIVE_COLOR_SET) != 0);
+ DRW_shgroup_uniform_texture(grp, "densityTexture", mds->tex);
+ DRW_shgroup_uniform_texture(grp, "shadowTexture", mds->tex_shadow);
DRW_shgroup_uniform_texture(
- grp, "flameTexture", (sds->tex_flame) ? sds->tex_flame : e_data.dummy_tex);
+ grp, "flameTexture", (mds->tex_flame) ? mds->tex_flame : e_data.dummy_tex);
DRW_shgroup_uniform_texture(
- grp, "flameColorTexture", (sds->tex_flame) ? sds->tex_flame_coba : e_data.dummy_coba_tex);
+ grp, "flameColorTexture", (mds->tex_flame) ? mds->tex_flame_coba : e_data.dummy_coba_tex);
DRW_shgroup_uniform_vec3(
- grp, "activeColor", (use_constant_color) ? sds->active_color : white, 1);
+ grp, "activeColor", (use_constant_color) ? mds->active_color : white, 1);
}
DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &dtxl->depth);
- DRW_shgroup_uniform_float_copy(grp, "densityScale", 10.0f * sds->display_thickness);
+ DRW_shgroup_uniform_float_copy(grp, "densityScale", 10.0f * mds->display_thickness);
if (use_slice) {
- DRW_shgroup_call_object(grp, DRW_cache_quad_get(), ob);
+ DRW_shgroup_call(grp, DRW_cache_quad_get(), ob);
}
else {
- DRW_shgroup_call_object(grp, DRW_cache_cube_get(), ob);
+ DRW_shgroup_call(grp, DRW_cache_cube_get(), ob);
}
- BLI_addtail(&wpd->smoke_domains, BLI_genericNodeN(smd));
+ BLI_addtail(&wpd->smoke_domains, BLI_genericNodeN(mmd));
}
void workbench_volume_smoke_textures_free(WORKBENCH_PrivateData *wpd)
diff --cc source/blender/draw/modes/object_mode.c
index 954d2e31cbf,9fc11e4f36f..2b86747fdc2
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@@ -36,8 -36,9 +36,9 @@@
#include "DNA_lightprobe_types.h"
#include "DNA_particle_types.h"
#include "DNA_rigidbody_types.h"
-#include "DNA_smoke_types.h"
+#include "DNA_manta_types.h"
#include "DNA_view3d_types.h"
+ #include "DNA_screen_types.h"
#include "DNA_world_types.h"
#include "BKE_anim.h"
@@@ -2413,61 -2701,52 +2701,60 @@@ static void DRW_shgroup_volume_extra(OB
DRW_object_wire_theme_get(ob, view_layer, &color);
- /* Small cube showing voxel size. */
+ /* Small cube showing voxel size (adjusts with adaptive domain) */
+ float min[3], max[3], size[3];
+ madd_v3fl_v3fl_v3fl_v3i(min, mds->p0, mds->cell_size, mds->res_min);
+ madd_v3fl_v3fl_v3fl_v3i(max, mds->p0, mds->cell_size, mds->res_max);
+ sub_v3_v3v3(size, max, min);
float voxel_cubemat[4][4] = {{0.0f}};
- voxel_cubemat[0][0] = 1.0f / (float)sds->res[0];
- voxel_cubemat[1][1] = 1.0f / (float)sds->res[1];
- voxel_cubemat[2][2] = 1.0f / (float)sds->res[2];
- voxel_cubemat[3][0] = voxel_cubemat[3][1] = voxel_cubemat[3][2] = -1.0f;
+ /* scale small cube */
+ voxel_cubemat[0][0] = (1.0f / (float)mds->res[0]) * size[0] * ob->obmat[0][0] * 0.5;
+ voxel_cubemat[1][1] = (1.0f / (float)mds->res[1]) * size[1] * ob->obmat[1][1] * 0.5;
+ voxel_cubemat[2][2] = (1.0f / (float)mds->res[2]) * size[2] * ob->obmat[2][2] * 0.5;
+ /* translate small cube */
+ voxel_cubemat[3][0] = min[0] * ob->obmat[0][0] + ob->obmat[3][0];
+ voxel_cubemat[3][1] = min[1] * ob->obmat[1][1] + ob->obmat[3][1];
+ voxel_cubemat[3][2] = min[2] * ob->obmat[2][2] + ob->obmat[3][2];
voxel_cubemat[3][3] = 1.0f;
+ /* move small cube into the domain (before centered on vertex) */
translate_m4(voxel_cubemat, 1.0f, 1.0f, 1.0f);
- mul_m4_m4m4(voxel_cubemat, ob->obmat, voxel_cubemat);
- DRW_buffer_add_entry(sgl->cube, color, &one, voxel_cubemat);
+ DRW_buffer_add_entry(sgl->empties.cube, color, &one, voxel_cubemat);
/* Don't show smoke before simulation starts, this could be made an option in the future. */
- if (!sds->draw_velocity || !sds->fluid || CFRA < sds->point_cache[0]->startframe) {
+ if (!mds->draw_velocity || !mds->fluid || CFRA < mds->point_cache[0]->startframe) {
return;
}
- const bool use_needle = (sds->vector_draw_type == VECTOR_DRAW_NEEDLE);
+ const bool use_needle = (mds->vector_draw_type == VECTOR_DRAW_NEEDLE);
int line_count = (use_needle) ? 6 : 1;
int slice_axis = -1;
- line_count *= sds->res[0] * sds->res[1] * sds->res[2];
+ line_count *= mds->res[0] * mds->res[1] * mds->res[2];
- if (sds->slice_method == MOD_SMOKE_SLICE_AXIS_ALIGNED &&
- sds->axis_slice_method == AXIS_SLICE_SINGLE) {
+ if (mds->slice_method == FLUID_DOMAIN_SLICE_AXIS_ALIGNED &&
+ mds->axis_slice_method == AXIS_SLICE_SINGLE) {
- float invviewmat[4][4];
- DRW_viewport_matrix_get(invviewmat, DRW_MAT_VIEWINV);
+ float viewinv[4][4];
+ DRW_view_viewmat_get(NULL, viewinv, true);
- const int axis = (mds->slice_axis == SLICE_AXIS_AUTO) ?
- axis_dominant_v3_single(invviewmat[2]) :
- mds->slice_axis - 1;
- const int axis = (sds->slice_axis == SLICE_AXIS_AUTO) ? axis_dominant_v3_single(viewinv[2]) :
- sds->slice_axis - 1;
++ const int axis = (mds->slice_axis == SLICE_AXIS_AUTO) ? axis_dominant_v3_single(viewinv[2]) :
++ mds->slice_axis - 1;
slice_axis = axis;
- line_count /= sds->res[axis];
+ line_count /= mds->res[axis];
}
- GPU_create_smoke_velocity(smd);
+ GPU_create_smoke_velocity(mmd);
DRWShadingGroup *grp = DRW_shgroup_create(volume_velocity_shader_get(use_needle),
sgl->non_meshes);
- DRW_shgroup_uniform_texture(grp, "velocityX", sds->tex_velocity_x);
- DRW_shgroup_uniform_texture(grp, "velocityY", sds->tex_velocity_y);
- DRW_shgroup_uniform_texture(grp, "velocityZ", sds->tex_velocity_z);
- DRW_shgroup_uniform_float_copy(grp, "displaySize", sds->vector_scale);
- DRW_shgroup_uniform_float_copy(grp, "slicePosition", sds->slice_depth);
+ DRW_shgroup_uniform_texture(grp, "velocityX", mds->tex_velocity_x);
+ DRW_shgroup_uniform_texture(grp, "velocityY", mds->tex_velocity_y);
+ DRW_shgroup_uniform_texture(grp, "velocityZ", mds->tex_velocity_z);
+ DRW_shgroup_uniform_float_copy(grp, "displaySize", mds->vector_scale);
+ DRW_shgroup_uniform_float_copy(grp, "slicePosition", mds->slice_depth);
DRW_shgroup_uniform_int_copy(grp, "sliceAxis", slice_axis);
- DRW_shgroup_call_procedural_lines(grp, line_count, ob->obmat);
+ DRW_shgroup_call_procedural_lines(grp, ob, line_count);
- BLI_addtail(&e_data.smoke_domains, BLI_genericNodeN(smd));
+ BLI_addtail(&e_data.smoke_domains, BLI_genericNodeN(mmd));
}
static void volumes_free_smoke_textures(void)
@@@ -3443,12 -3743,12 +3751,12 @@@ static void OBJECT_cache_populate(void
float *color, axes_size = 1.0f;
DRW_object_wire_theme_get(ob, view_layer, &color);
- DRW_buffer_add_entry(sgl->empty_axes, color, &axes_size, ob->obmat);
+ DRW_buffer_add_entry(sgl->empties.empty_axes, color, &axes_size, ob->obmat);
}
- if ((md = modifiers_findByType(ob, eModifierType_Smoke)) &&
+ if ((md = modifiers_findByType(ob, eModifierType_Manta)) &&
(modifier_isEnabled(scene, md, eModifierMode_Realtime)) &&
- (((SmokeModifierData *)md)->domain != NULL)) {
+ (((MantaModifierData *)md)->domain != NULL)) {
DRW_shgroup_volume_extra(sgl, ob, view_layer, scene, md);
}
}
diff --cc source/blender/gpu/intern/gpu_draw.c
index 0054e9eb465,be3655648f5..b5c1148ea77
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@@ -1034,21 -1120,22 +1117,22 @@@ static GPUTexture *create_density_textu
return tex;
}
-static GPUTexture *create_flame_texture(SmokeDomainSettings *sds, int highres)
+static GPUTexture *create_flame_texture(MantaDomainSettings *mds, int highres)
{
float *source = NULL;
- const bool has_fuel = (highres) ? smoke_turbulence_has_fuel(sds->wt) :
- smoke_has_fuel(sds->fluid);
- int *
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list