diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_smoke.h | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 11 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_volumes.c | 6 | ||||
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_volume.c | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 6 |
6 files changed, 33 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h index cac207b3922..243420c82bf 100644 --- a/source/blender/blenkernel/BKE_smoke.h +++ b/source/blender/blenkernel/BKE_smoke.h @@ -23,6 +23,10 @@ /** \file \ingroup bke */ +struct Scene; +struct SmokeDomainSettings; +struct SmokeModifierData; + typedef float (*bresenham_callback)(float *result, float *input, int res[3], int *pixel, float *tRay, float correct); struct Mesh *smokeModifier_do( @@ -34,7 +38,7 @@ 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); @@ -42,4 +46,6 @@ void BKE_smoke_reallocate_highres_fluid(struct SmokeDomainSettings *sds, float d float BKE_smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3]); int BKE_smoke_get_data_flags(struct SmokeDomainSettings *sds); +bool BKE_smoke_show_highres(struct Scene *scene, struct SmokeDomainSettings *sds); + #endif /* __BKE_SMOKE_H__ */ diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index abe9aacf878..94b626d38e0 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -3148,3 +3148,14 @@ int BKE_smoke_get_data_flags(SmokeDomainSettings *sds) } #endif /* WITH_SMOKE */ + +bool BKE_smoke_show_highres(Scene *scene, SmokeDomainSettings *sds) +{ + if ((sds->viewsettings & MOD_SMOKE_VIEW_SHOW_HIGHRES) == 0) { + return false; + } + if (scene->r.mode & R_SIMPLIFY) { + return !scene->r.simplify_smoke_ignore_highres; + } + return true; +} diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c index 930014979af..997e42ef426 100644 --- a/source/blender/draw/engines/eevee/eevee_volumes.c +++ b/source/blender/draw/engines/eevee/eevee_volumes.c @@ -32,6 +32,7 @@ #include "BKE_modifier.h" #include "BKE_mesh.h" +#include "BKE_smoke.h" #include "ED_screen.h" @@ -506,10 +507,11 @@ void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *ved const bool show_smoke = ((int)DEG_get_ctime(draw_ctx->depsgraph) >= sds->point_cache[0]->startframe); if (sds->fluid && show_smoke) { - if (!sds->wt || !(sds->viewsettings & MOD_SMOKE_VIEW_SHOW_HIGHRES)) { + const bool show_highres = BKE_smoke_show_highres(scene, sds); + if (!sds->wt || !show_highres) { GPU_create_smoke(smd, 0); } - else if (sds->wt && (sds->viewsettings & MOD_SMOKE_VIEW_SHOW_HIGHRES)) { + else if (sds->wt && show_highres) { GPU_create_smoke(smd, 1); } BLI_addtail(&e_data.smoke_domains, BLI_genericNodeN(smd)); diff --git a/source/blender/draw/engines/workbench/workbench_volume.c b/source/blender/draw/engines/workbench/workbench_volume.c index da107336945..30a75accce9 100644 --- a/source/blender/draw/engines/workbench/workbench_volume.c +++ b/source/blender/draw/engines/workbench/workbench_volume.c @@ -22,6 +22,7 @@ #include "workbench_private.h" #include "BKE_object.h" +#include "BKE_smoke.h" #include "BLI_rand.h" #include "BLI_dynstr.h" @@ -124,13 +125,14 @@ void workbench_volume_cache_populate(WORKBENCH_Data *vedata, Scene *scene, Objec } wpd->volumes_do = true; + const bool show_highres = BKE_smoke_show_highres(scene, sds); if (sds->use_coba) { GPU_create_smoke_coba_field(smd); } - else if (!sds->wt || !(sds->viewsettings & MOD_SMOKE_VIEW_SHOW_HIGHRES)) { + else if (!sds->wt || !show_highres) { GPU_create_smoke(smd, 0); } - else if (sds->wt && (sds->viewsettings & MOD_SMOKE_VIEW_SHOW_HIGHRES)) { + else if (sds->wt && show_highres) { GPU_create_smoke(smd, 1); } diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 733d2fbab30..b0da74a13d8 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -738,7 +738,7 @@ typedef struct RenderData { short simplify_subsurf; short simplify_subsurf_render; short simplify_gpencil; - short pad10; + short simplify_smoke_ignore_highres; float simplify_particles; float simplify_particles_render; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index bc48192aa4d..e151cb974ed 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1556,6 +1556,7 @@ static void rna_Scene_use_simplify_update(Main *bmain, Scene *UNUSED(scene), Poi } WM_main_add_notifier(NC_GEOM | ND_DATA, NULL); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); DEG_id_tag_update(&sce->id, 0); } @@ -5490,6 +5491,11 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage during rendering"); RNA_def_property_update(prop, 0, "rna_Scene_simplify_update"); + prop = RNA_def_property(srna, "use_simplify_smoke_highres", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "simplify_smoke_ignore_highres", 1); + RNA_def_property_ui_text(prop, "Use Smoke Highres", "Allow drawing high-res smoke in viewport"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); + /* Grease Pencil - Simplify Options */ prop = RNA_def_property(srna, "simplify_gpencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "simplify_gpencil", SIMPLIFY_GPENCIL_ENABLE); |