diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-05-12 18:54:20 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-05-12 18:54:20 +0300 |
commit | 33f9fe3c620fef1d1ad2cb3443bf503afdb9db3b (patch) | |
tree | a841b5f04d635d0af308f6bfce94c69ca6a2e6c1 /source | |
parent | 25c67a65d686aa04570db7409618ad779318c17a (diff) | |
parent | f24e9bb0380936bcaf6c194b54342a2977784cff (diff) |
Merge branch 'blender-v2.83-release'
Conflicts:
release/scripts/startup/bl_ui/properties_render.py
source/blender/blenkernel/BKE_blender_version.h
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 3 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 7 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_antialiasing.c | 2 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_shader.c | 3 | ||||
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_engine.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 33 |
8 files changed, 57 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index c4c4314acea..a7ece2e3167 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -402,7 +402,7 @@ typedef struct SculptSession { /* TODO: identify sculpt-only fields */ // struct { ... } sculpt; } mode; - int mode_type; + eObjectMode mode_type; /* This flag prevents PBVH from being freed when creating the vp_handle for texture paint. */ bool building_vp_handle; diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 650b52e281a..be6a4e4022b 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -155,6 +155,9 @@ static void scene_init_data(ID *id) scene->unit.mass_unit = (uchar)bUnit_GetBaseUnitOfType(USER_UNIT_METRIC, B_UNIT_MASS); scene->unit.time_unit = (uchar)bUnit_GetBaseUnitOfType(USER_UNIT_METRIC, B_UNIT_TIME); + /* Anti-aliasing threshold. */ + scene->grease_pencil_settings.smaa_threshold = 1.0f; + { ParticleEditSettings *pset; pset = &scene->toolsettings->particle; diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 7602b05ca76..4261682a17c 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -5198,6 +5198,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 283, 16)) { + /* Init SMAA threshold for grease pencil render. */ + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + scene->grease_pencil_settings.smaa_threshold = 1.0f; + } + } + /** * Versioning code until next subversion bump goes here. * diff --git a/source/blender/draw/engines/gpencil/gpencil_antialiasing.c b/source/blender/draw/engines/gpencil/gpencil_antialiasing.c index e81073db4a5..4dd5e3b2da1 100644 --- a/source/blender/draw/engines/gpencil/gpencil_antialiasing.c +++ b/source/blender/draw/engines/gpencil/gpencil_antialiasing.c @@ -115,6 +115,8 @@ void GPENCIL_antialiasing_init(struct GPENCIL_Data *vedata) DRW_shgroup_uniform_texture(grp, "colorTex", pd->color_tx); DRW_shgroup_uniform_texture(grp, "revealTex", pd->reveal_tx); DRW_shgroup_uniform_vec4_copy(grp, "viewportMetrics", metrics); + DRW_shgroup_uniform_float_copy( + grp, "lumaWeight", pd->scene->grease_pencil_settings.smaa_threshold); DRW_shgroup_clear_framebuffer(grp, GPU_COLOR_BIT, 0, 0, 0, 0, 0.0f, 0x0); DRW_shgroup_call_procedural_triangles(grp, NULL, 1); diff --git a/source/blender/draw/engines/gpencil/gpencil_shader.c b/source/blender/draw/engines/gpencil/gpencil_shader.c index fe095b1b916..6284e0a648c 100644 --- a/source/blender/draw/engines/gpencil/gpencil_shader.c +++ b/source/blender/draw/engines/gpencil/gpencil_shader.c @@ -135,10 +135,11 @@ GPUShader *GPENCIL_shader_antialiasing(int stage) }, .defs = (const char *[]){ + "uniform float lumaWeight;\n", "#define SMAA_GLSL_3\n", "#define SMAA_RT_METRICS viewportMetrics\n", "#define SMAA_PRESET_HIGH\n", - "#define SMAA_LUMA_WEIGHT float4(1.0, 1.0, 1.0, 0.0)\n", + "#define SMAA_LUMA_WEIGHT float4(lumaWeight, lumaWeight, lumaWeight, 0.0)\n", "#define SMAA_NO_DISCARD\n", stage_define, NULL, diff --git a/source/blender/draw/engines/overlay/overlay_engine.c b/source/blender/draw/engines/overlay/overlay_engine.c index 395ea9f9a8f..e875f2c8291 100644 --- a/source/blender/draw/engines/overlay/overlay_engine.c +++ b/source/blender/draw/engines/overlay/overlay_engine.c @@ -30,6 +30,7 @@ #include "ED_view3d.h" #include "BKE_object.h" +#include "BKE_paint.h" #include "overlay_engine.h" #include "overlay_private.h" @@ -237,7 +238,8 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob) const bool in_particle_edit_mode = ob->mode == OB_MODE_PARTICLE_EDIT; const bool in_paint_mode = (ob == draw_ctx->obact) && (draw_ctx->object_mode & OB_MODE_ALL_PAINT); - const bool in_sculpt_mode = (ob == draw_ctx->obact) && (ob->sculpt != NULL); + const bool in_sculpt_mode = (ob == draw_ctx->obact) && (ob->sculpt != NULL) && + (ob->sculpt->mode_type == OB_MODE_SCULPT); const bool has_surface = ELEM(ob->type, OB_MESH, OB_CURVE, diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 3ed9ce1ea06..1533b82ad4e 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1644,6 +1644,11 @@ typedef struct SceneEEVEE { float light_threshold; } SceneEEVEE; +typedef struct SceneGpencil { + float smaa_threshold; + char _pad[4]; +} SceneGpencil; + /* *************************************************************** */ /* Scene ID-Block */ @@ -1775,6 +1780,7 @@ typedef struct Scene { struct SceneDisplay display; struct SceneEEVEE eevee; + struct SceneGpencil grease_pencil_settings; } Scene; /* **************** RENDERDATA ********************* */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index a04194b5206..6423175e2f4 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1137,6 +1137,11 @@ static char *rna_SceneEEVEE_path(PointerRNA *UNUSED(ptr)) return BLI_strdup("eevee"); } +static char *rna_SceneGpencil_path(PointerRNA *UNUSED(ptr)) +{ + return BLI_strdup("grease_pencil_settings"); +} + static int rna_RenderSettings_stereoViews_skip(CollectionPropertyIterator *iter, void *UNUSED(data)) { @@ -7204,6 +7209,28 @@ static void rna_def_scene_eevee(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); } +static void rna_def_scene_gpencil(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "SceneGpencil", NULL); + RNA_def_struct_path_func(srna, "rna_SceneGpencil_path"); + RNA_def_struct_ui_text(srna, "Grease Pencil Render", "Render settings"); + + prop = RNA_def_property(srna, "antialias_threshold", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "smaa_threshold"); + RNA_def_property_float_default(prop, 1.0f); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3); + RNA_def_property_ui_text(prop, + "Anti-Aliasing Threshold", + "Threshold for edge detection algorithm (higher values might overblur " + "some part of the image)"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); +} + void RNA_def_scene(BlenderRNA *brna) { StructRNA *srna; @@ -7677,6 +7704,11 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_struct_type(prop, "SceneEEVEE"); RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene"); + /* Grease Pencil */ + prop = RNA_def_property(srna, "grease_pencil_settings", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "SceneGpencil"); + RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil settings for the scene"); + /* Nestled Data */ /* *** Non-Animated *** */ RNA_define_animate_sdna(false); @@ -7695,6 +7727,7 @@ void RNA_def_scene(BlenderRNA *brna) rna_def_scene_display(brna); rna_def_scene_eevee(brna); rna_def_view_layer_eevee(brna); + rna_def_scene_gpencil(brna); RNA_define_animate_sdna(true); /* *** Animated *** */ rna_def_scene_render_data(brna); |