Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_volume.c
| Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | void workbench_volume_cache_populate(WORKBENCH_Data *vedata, | ||||
| } | } | ||||
| else if (!(mds->flags & FLUID_DOMAIN_USE_NOISE)) { | else if (!(mds->flags & FLUID_DOMAIN_USE_NOISE)) { | ||||
| GPU_create_smoke(mmd, 0); | GPU_create_smoke(mmd, 0); | ||||
| } | } | ||||
| else if (mds->flags & FLUID_DOMAIN_USE_NOISE) { | else if (mds->flags & FLUID_DOMAIN_USE_NOISE) { | ||||
| GPU_create_smoke(mmd, 1); | GPU_create_smoke(mmd, 1); | ||||
| } | } | ||||
| if ((!mds->use_coba && mds->tex == NULL) || (mds->use_coba && mds->tex_field == NULL)) { | if ((!mds->use_coba && (mds->tex_density == NULL && mds->tex_color == NULL)) || | ||||
| (mds->use_coba && mds->tex_field == NULL)) { | |||||
| return; | return; | ||||
| } | } | ||||
| const bool use_slice = (mds->slice_method == FLUID_DOMAIN_SLICE_AXIS_ALIGNED && | const bool use_slice = (mds->slice_method == FLUID_DOMAIN_SLICE_AXIS_ALIGNED && | ||||
| mds->axis_slice_method == AXIS_SLICE_SINGLE); | mds->axis_slice_method == AXIS_SLICE_SINGLE); | ||||
| const bool cubic_interp = (mds->interp_method == VOLUME_INTERP_CUBIC); | const bool cubic_interp = (mds->interp_method == VOLUME_INTERP_CUBIC); | ||||
| GPUShader *sh = volume_shader_get(use_slice, mds->use_coba, cubic_interp); | GPUShader *sh = volume_shader_get(use_slice, mds->use_coba, cubic_interp); | ||||
| Show All 38 Lines | void workbench_volume_cache_populate(WORKBENCH_Data *vedata, | ||||
| if (mds->use_coba) { | if (mds->use_coba) { | ||||
| DRW_shgroup_uniform_texture(grp, "densityTexture", mds->tex_field); | DRW_shgroup_uniform_texture(grp, "densityTexture", mds->tex_field); | ||||
| DRW_shgroup_uniform_texture(grp, "transferTexture", mds->tex_coba); | DRW_shgroup_uniform_texture(grp, "transferTexture", mds->tex_coba); | ||||
| } | } | ||||
| else { | else { | ||||
| static float white[3] = {1.0f, 1.0f, 1.0f}; | static float white[3] = {1.0f, 1.0f, 1.0f}; | ||||
| bool use_constant_color = ((mds->active_fields & FLUID_DOMAIN_ACTIVE_COLORS) == 0 && | bool use_constant_color = ((mds->active_fields & FLUID_DOMAIN_ACTIVE_COLORS) == 0 && | ||||
| (mds->active_fields & FLUID_DOMAIN_ACTIVE_COLOR_SET) != 0); | (mds->active_fields & FLUID_DOMAIN_ACTIVE_COLOR_SET) != 0); | ||||
| DRW_shgroup_uniform_texture(grp, "densityTexture", mds->tex); | DRW_shgroup_uniform_texture( | ||||
| grp, "densityTexture", (mds->tex_color) ? mds->tex_color : mds->tex_density); | |||||
| DRW_shgroup_uniform_texture(grp, "shadowTexture", mds->tex_shadow); | DRW_shgroup_uniform_texture(grp, "shadowTexture", mds->tex_shadow); | ||||
| DRW_shgroup_uniform_texture( | DRW_shgroup_uniform_texture( | ||||
| grp, "flameTexture", (mds->tex_flame) ? mds->tex_flame : e_data.dummy_tex); | grp, "flameTexture", (mds->tex_flame) ? mds->tex_flame : e_data.dummy_tex); | ||||
| DRW_shgroup_uniform_texture( | DRW_shgroup_uniform_texture( | ||||
| grp, "flameColorTexture", (mds->tex_flame) ? mds->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( | DRW_shgroup_uniform_vec3( | ||||
| grp, "activeColor", (use_constant_color) ? mds->active_color : white, 1); | grp, "activeColor", (use_constant_color) ? mds->active_color : white, 1); | ||||
| } | } | ||||
| Show All 27 Lines | |||||