Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_volumes.c
| Show First 20 Lines • Show All 526 Lines • ▼ Show 20 Lines | if (((ob->base_flag & BASE_FROM_DUPLI) == 0) && | ||||
| SmokeModifierData *smd = (SmokeModifierData *)md; | SmokeModifierData *smd = (SmokeModifierData *)md; | ||||
| SmokeDomainSettings *sds = smd->domain; | SmokeDomainSettings *sds = smd->domain; | ||||
| if (sds == NULL) { | if (sds == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* Don't show smoke before simulation starts, this could be made an option in the future. */ | /* Don't show smoke before simulation starts, this could be made an option in the future. */ | ||||
| const bool show_smoke = ((int)DEG_get_ctime(draw_ctx->depsgraph) >= sds->point_cache[0]->startframe); | /* (sebbas): Always show smoke for manta */ | ||||
| /* const bool show_smoke = ((int)DEG_get_ctime(draw_ctx->depsgraph) >= sds->point_cache[0]->startframe); */ | |||||
| if (sds->fluid && show_smoke) { | if (sds->fluid && (sds->type == FLUID_DOMAIN_TYPE_GAS) /* && show_smoke */ ) { | ||||
| const bool show_highres = BKE_smoke_show_highres(scene, sds); | if (!(sds->flags & FLUID_DOMAIN_USE_NOISE)) { | ||||
| if (!sds->wt || !show_highres) { | |||||
| GPU_create_smoke(smd, 0); | GPU_create_smoke(smd, 0); | ||||
| } | } | ||||
| else if (sds->wt && show_highres) { | else if (sds->flags & FLUID_DOMAIN_USE_NOISE) { | ||||
| GPU_create_smoke(smd, 1); | GPU_create_smoke(smd, 1); | ||||
| } | } | ||||
| BLI_addtail(&e_data.smoke_domains, BLI_genericNodeN(smd)); | BLI_addtail(&e_data.smoke_domains, BLI_genericNodeN(smd)); | ||||
| } | } | ||||
| if (sds->tex != NULL) { | if (sds->tex != NULL) { | ||||
| DRW_shgroup_uniform_texture_ref(grp, "sampdensity", &sds->tex); | DRW_shgroup_uniform_texture_ref(grp, "sampdensity", &sds->tex); | ||||
| } | } | ||||
| if (sds->tex_flame != NULL) { | if (sds->tex_flame != NULL) { | ||||
| DRW_shgroup_uniform_texture_ref(grp, "sampflame", &sds->tex_flame); | DRW_shgroup_uniform_texture_ref(grp, "sampflame", &sds->tex_flame); | ||||
| } | } | ||||
| /* Constant Volume color. */ | /* Constant Volume color. */ | ||||
| static float white[3] = {1.0f, 1.0f, 1.0f}; | static float white[3] = {1.0f, 1.0f, 1.0f}; | ||||
| bool use_constant_color = ((sds->active_fields & SM_ACTIVE_COLORS) == 0 && | bool use_constant_color = ((sds->active_fields & FLUID_DOMAIN_ACTIVE_COLORS) == 0 && | ||||
| (sds->active_fields & SM_ACTIVE_COLOR_SET) != 0); | (sds->active_fields & FLUID_DOMAIN_ACTIVE_COLOR_SET) != 0); | ||||
| DRW_shgroup_uniform_vec3(grp, "volumeColor", (use_constant_color) ? sds->active_color : white, 1); | DRW_shgroup_uniform_vec3(grp, "volumeColor", (use_constant_color) ? sds->active_color : white, 1); | ||||
| /* Output is such that 0..1 maps to 0..1000K */ | /* Output is such that 0..1 maps to 0..1000K */ | ||||
| DRW_shgroup_uniform_vec2(grp, "unftemperature", &sds->flame_ignition, 1); | DRW_shgroup_uniform_vec2(grp, "unftemperature", &sds->flame_ignition, 1); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines | |||||