[Bf-blender-cvs] [e4cd623fefd] fluid-mantaflow: Merge branch 'internUpdate' into sourceUpdate

Sebastián Barschkis noreply at git.blender.org
Sat Apr 6 22:13:32 CEST 2019


Commit: e4cd623fefd40281a20316b06da671c2050ae4f2
Author: Sebastián Barschkis
Date:   Tue Mar 26 17:47:15 2019 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rBe4cd623fefd40281a20316b06da671c2050ae4f2

Merge branch 'internUpdate' into sourceUpdate

===================================================================



===================================================================

diff --cc source/blender/blenkernel/BKE_smoke.h
index 336c29eff48,a3326c433c4..38193bb6df4
--- a/source/blender/blenkernel/BKE_smoke.h
+++ b/source/blender/blenkernel/BKE_smoke.h
@@@ -40,14 -35,18 +35,17 @@@ struct Mesh *smokeModifier_do
          struct Scene *scene,
          struct Object *ob, struct Mesh *me);
  
- void smoke_reallocate_fluid(struct SmokeDomainSettings *sds, int res[3], int free_old);
- void smoke_reallocate_highres_fluid(struct SmokeDomainSettings *sds, int res[3]);
  void smokeModifier_free(struct SmokeModifierData *smd);
  void smokeModifier_reset(struct SmokeModifierData *smd);
 -void smokeModifier_reset_turbulence(struct SmokeModifierData *smd);
  void smokeModifier_createType(struct SmokeModifierData *smd);
- void smokeModifier_copy(const SmokeModifierData *smd, struct SmokeModifierData *tsmd, const int flag);
+ void smokeModifier_copy(const struct SmokeModifierData *smd, struct SmokeModifierData *tsmd, const int flag);
+ 
 -void BKE_smoke_reallocate_fluid(struct SmokeDomainSettings *sds, float dx, int res[3], int free_old);
 -void BKE_smoke_reallocate_highres_fluid(struct SmokeDomainSettings *sds, float dx, int res[3], int free_old);
++void BKE_smoke_reallocate_fluid(struct SmokeDomainSettings *sds, int res[3], int free_old);
++void BKE_smoke_reallocate_highres_fluid(struct SmokeDomainSettings *sds, int res[3]);
+ 
+ float BKE_smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3]);
+ int BKE_smoke_get_data_flags(struct SmokeDomainSettings *sds);
  
- float smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3]);
- int smoke_get_data_flags(struct SmokeDomainSettings *sds);
+ bool BKE_smoke_show_highres(struct Scene *scene, struct SmokeDomainSettings *sds);
  
  #endif /* __BKE_SMOKE_H__ */
diff --cc source/blender/blenkernel/intern/pointcache.c
index 7c46ed20967,3371c3dbe48..bb1b3b0040c
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@@ -810,12 -806,12 +806,12 @@@ static int ptcache_smoke_read(PTCacheFi
  	/* reallocate fluid if needed*/
  	if (reallocate) {
  		sds->active_fields = active_fields | cache_fields;
- 		smoke_reallocate_fluid(sds, ch_res, 1);
 -		BKE_smoke_reallocate_fluid(sds, ch_dx, ch_res, 1);
++		BKE_smoke_reallocate_fluid(sds, ch_res, 1);
  		sds->dx = ch_dx;
- 		VECCOPY(sds->res, ch_res);
+ 		copy_v3_v3_int(sds->res, ch_res);
  		sds->total_cells = ch_res[0]*ch_res[1]*ch_res[2];
 -		if (sds->flags & MOD_SMOKE_HIGHRES) {
 -			BKE_smoke_reallocate_highres_fluid(sds, ch_dx, ch_res, 1);
 +		if (sds->flags & FLUID_DOMAIN_USE_NOISE) {
- 			smoke_reallocate_highres_fluid(sds, ch_res);
++			BKE_smoke_reallocate_highres_fluid(sds, ch_res);
  		}
  	}
  
@@@ -1093,9 -1089,9 +1089,8 @@@ static int ptcache_smoke_openvdb_read(s
  		sds->dx = cache_dx;
  		copy_v3_v3_int(sds->res, cache_res);
  		sds->total_cells = cache_res[0] * cache_res[1] * cache_res[2];
--
 -		if (sds->flags & MOD_SMOKE_HIGHRES) {
 -			BKE_smoke_reallocate_highres_fluid(sds, cache_dx, cache_res, 1);
 +		if (sds->flags & FLUID_DOMAIN_USE_NOISE) {
- 			smoke_reallocate_highres_fluid(sds, cache_res, 1);
++			BKE_smoke_reallocate_highres_fluid(sds, cache_res);
  		}
  	}
  
diff --cc source/blender/draw/engines/workbench/workbench_volume.c
index 51a4ac3c6b1,0f5debc46d8..8a28d16597e
--- a/source/blender/draw/engines/workbench/workbench_volume.c
+++ b/source/blender/draw/engines/workbench/workbench_volume.c
@@@ -116,8 -143,10 +143,10 @@@ void workbench_volume_cache_populate(WO
  		return;
  	}
  
 -	const bool use_slice = (sds->slice_method == MOD_SMOKE_SLICE_AXIS_ALIGNED &&
 +	const bool use_slice = (sds->slice_method == FLUID_DOMAIN_SLICE_AXIS_ALIGNED &&
  	                        sds->axis_slice_method == AXIS_SLICE_SINGLE);
+ 	const bool cubic_interp = (sds->interp_method == VOLUME_INTERP_CUBIC);
+ 	GPUShader *sh = volume_shader_get(use_slice, sds->use_coba, cubic_interp);
  
  	if (use_slice) {
  		float invviewmat[4][4];
diff --cc source/blender/gpu/CMakeLists.txt
index 7461893649f,b76edf4068a..264651e7e7b
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@@ -244,9 -242,11 +243,11 @@@ data_to_c_simple(shaders/gpu_shader_gpe
  data_to_c_simple(shaders/gpu_shader_gpencil_fill_vert.glsl SRC)
  data_to_c_simple(shaders/gpu_shader_gpencil_fill_frag.glsl SRC)
  
+ data_to_c_simple(shaders/gpu_shader_cfg_world_clip_lib.glsl SRC)
+ 
  
 -if(WITH_MOD_SMOKE)
 -	add_definitions(-DWITH_SMOKE)
 +if(WITH_MOD_MANTA)
 +	add_definitions(-DWITH_MANTA)
  endif()
  
  add_definitions(${GL_DEFINITIONS})
diff --cc source/blender/gpu/intern/gpu_draw.c
index f89d42e07e9,c9989703d5b..0bd8a953388
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@@ -80,11 -71,11 +71,11 @@@
  
  #include "PIL_time.h"
  
 -#ifdef WITH_SMOKE
 -#  include "smoke_API.h"
 +#ifdef WITH_MANTA
 +#	include "manta_fluid_API.h"
  #endif
  
- extern Material defmaterial; /* from material.c */
+ static void gpu_free_image_immediate(Image *ima);
  
  //* Checking powers of two for images since OpenGL ES requires it */
  #ifdef WITH_DDS
@@@ -1000,10 -927,10 +927,10 @@@ static GPUTexture *create_field_texture
  static GPUTexture *create_density_texture(SmokeDomainSettings *sds, int highres)
  {
  	float *data = NULL, *source;
 -	int cell_count = (highres) ? smoke_turbulence_get_cells(sds->wt) : sds->total_cells;
 -	const bool has_color = (highres) ? smoke_turbulence_has_colors(sds->wt) : smoke_has_colors(sds->fluid);
 -	int *dim = (highres) ? sds->res_wt : sds->res;
 +	int cell_count = (highres) ? smoke_turbulence_get_cells(sds->fluid) : sds->total_cells;
 +	const bool has_color = (highres) ? smoke_turbulence_has_colors(sds->fluid) : smoke_has_colors(sds->fluid);
 +	int *dim = (highres) ? sds->res_noise : sds->res;
- 	GPUTextureFormat format = (has_color) ? GPU_RGBA8 : GPU_R8;
+ 	eGPUTextureFormat format = (has_color) ? GPU_RGBA8 : GPU_R8;
  
  	if (has_color) {
  		data = MEM_callocN(sizeof(float) * cell_count * 4, "smokeColorTexture");
@@@ -1162,12 -1089,12 +1089,12 @@@ void GPU_create_smoke_velocity(SmokeMod
  		}
  
  		if (!sds->tex_velocity_x) {
- 			sds->tex_velocity_x = GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_x, NULL);
- 			sds->tex_velocity_y = GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_y, NULL);
- 			sds->tex_velocity_z = GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_z, NULL);
+ 			sds->tex_velocity_x = GPU_texture_create_3d(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_x, NULL);
+ 			sds->tex_velocity_y = GPU_texture_create_3d(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_y, NULL);
+ 			sds->tex_velocity_z = GPU_texture_create_3d(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_z, NULL);
  		}
  	}
 -#else // WITH_SMOKE
 +#else // WITH_MANTA
  	smd->domain->tex_velocity_x = NULL;
  	smd->domain->tex_velocity_y = NULL;
  	smd->domain->tex_velocity_z = NULL;
diff --cc source/blender/makesdna/DNA_modifier_types.h
index c83fe495377,126ef912b15..1ec02e226d7
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@@ -408,10 -444,13 +444,13 @@@ typedef struct SmokeModifierData 
  	ModifierData modifier;
  
  	struct SmokeDomainSettings *domain;
- 	struct SmokeFlowSettings *flow; /* inflow, outflow, smoke objects */
- 	struct SmokeCollSettings *effec; /* effector objects (collision, guiding) */
+ 	/** Inflow, outflow, smoke objects. */
+ 	struct SmokeFlowSettings *flow;
 -	/** Collision objects. */
 -	struct SmokeCollSettings *coll;
++	/** Effector objects (collision, guiding). */
++	struct SmokeCollSettings *effec;
  	float time;
- 	int type;  /* domain, inflow, outflow, ... */
+ 	/** Domain, inflow, outflow, .... */
+ 	int type;
  } SmokeModifierData;
  
  /* Smoke modifier flags */
diff --cc source/blender/makesrna/intern/rna_modifier.c
index 8fb18c52c5e,a0d37d34526..1b8ca0bc585
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@@ -2939,8 -2944,8 +2944,8 @@@ static void rna_def_modifier_smoke(Blen
  		{0, "NONE", 0, "None", ""},
  		{MOD_SMOKE_TYPE_DOMAIN, "DOMAIN", 0, "Domain", ""},
  		{MOD_SMOKE_TYPE_FLOW, "FLOW", 0, "Flow", "Inflow/Outflow"},
 -		{MOD_SMOKE_TYPE_COLL, "COLLISION", 0, "Collision", ""},
 +		{MOD_SMOKE_TYPE_EFFEC, "EFFECTOR", 0, "Effector", ""},
- 		{0, NULL, 0, NULL, NULL}
+ 		{0, NULL, 0, NULL, NULL},
  	};
  
  	srna = RNA_def_struct(brna, "SmokeModifier", "Modifier");
diff --cc source/blender/modifiers/intern/MOD_smoke.c
index bbc702eb1d4,8578cf32626..2e57915dbd3
--- a/source/blender/modifiers/intern/MOD_smoke.c
+++ b/source/blender/modifiers/intern/MOD_smoke.c
@@@ -88,22 -75,20 +75,20 @@@ static void freeData(ModifierData *md
  	smokeModifier_free(smd);
  }
  
- static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
+ static void requiredDataMask(Object *UNUSED(ob), ModifierData *md, CustomData_MeshMasks *r_cddata_masks)
  {
  	SmokeModifierData *smd  = (SmokeModifierData *)md;
- 	CustomDataMask dataMask = 0;
  
  	if (smd && (smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow) {
 -		if (smd->flow->source == MOD_SMOKE_FLOW_SOURCE_MESH) {
 +		if (smd->flow->source == FLUID_FLOW_SOURCE_MESH) {
  			/* vertex groups */
  			if (smd->flow->vgroup_density)
- 				dataMask |= CD_MASK_MDEFORMVERT;
+ 				r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT;
  			/* uv layer */
 -			if (smd->flow->texture_type == MOD_SMOKE_FLOW_TEXTURE_MAP_UV)
 +			if (smd->flow->texture_type == FLUID_FLOW_TEXTURE_MAP_UV)
- 				dataMask |= CD_MASK_MTFACE;
+ 				r_cddata_masks->fmask |= CD_MASK_MTFACE;
  		}
  	}
- 	return dataMask;
  }
  
  static Mesh *applyModifier(
diff --cc source/blender/python/intern/bpy_app_build_options.c
index 07decab51e1,a80156a23bf..ac73e27c185
--- a/source/blender/python/intern/bpy_app_build_options.c
+++ b/source/blender/python/intern/bpy_app_build_options.c
@@@ -64,8 -59,7 +58,8 @@@ static PyStructSequence_Field app_built
  	{(char *)"openmp", NULL},
  	{(char *)"openvdb", NULL},
  	{(char *)"alembic", NULL},
 +	{(char *)"manta", NULL},
- 	{NULL}
+ 	{NULL},
  };



More information about the Bf-blender-cvs mailing list