[Bf-blender-cvs] [2897c90597b] soc-2019-npr: LANPR: rollback no-depth composition for GP, use object in front. Fixing chaining artefacts.
YimingWu
noreply at git.blender.org
Mon Jun 3 13:25:15 CEST 2019
Commit: 2897c90597bde05c653998c7790fac8f767d515c
Author: YimingWu
Date: Mon Jun 3 18:28:09 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB2897c90597bde05c653998c7790fac8f767d515c
LANPR: rollback no-depth composition for GP, use object in front. Fixing chaining artefacts.
===================================================================
M release/scripts/startup/bl_ui/properties_data_gpencil.py
M release/scripts/startup/bl_ui/properties_data_modifier.py
M source/blender/draw/engines/gpencil/gpencil_engine.c
M source/blender/draw/engines/gpencil/gpencil_engine.h
M source/blender/draw/engines/gpencil/gpencil_render.c
M source/blender/draw/engines/lanpr/lanpr_access.c
M source/blender/draw/engines/lanpr/lanpr_chain.c
M source/blender/makesdna/DNA_gpencil_types.h
M source/blender/makesrna/intern/rna_gpencil.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index cf3a780a146..44a7990d570 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -396,9 +396,6 @@ class DATA_PT_gpencil_strokes(DataButtonsPanel, Panel):
ob = context.object
gpd = context.gpencil
- col = layout.column(align=True)
- col.prop(gpd, "disable_depth_composition", expand=True, icon='IMAGE_ZDEPTH')
-
col = layout.column(align=True)
col.prop(gpd, "stroke_depth_order")
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index a2c19ebbd74..5a078d22295 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -2250,6 +2250,8 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
col = layout.column()
col.prop(md, "offset_object", text="Object")
+ col.prop(ob,"show_in_front", text='Overlay', expand=True)
+
col = layout.column()
col.separator()
col.label(text="Material:")
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 3466ea721b5..49cad084a5f 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -1035,20 +1035,8 @@ void GPENCIL_draw_scene(void *ved)
stl->storage->do_select_outline = 0;
}
- stl->storage->no_depth_composition = gpd->no_depth;
-
- /* draw mix pass */
- if (gpd->no_depth) {
- DRW_pass_state_remove(psl->mix_pass, DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS);
- }
-
DRW_draw_pass(psl->mix_pass);
- /* restore */
- if (gpd->no_depth) {
- DRW_pass_state_add(psl->mix_pass, DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS);
- }
-
/* disable select flag */
stl->storage->do_select_outline = 0;
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index 14a94e50323..a7e4c9d58d6 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -172,8 +172,6 @@ typedef struct GPENCIL_Storage {
short framebuffer_flag; /* flag what framebuffer need to create */
- int no_depth_composition;
-
int blend_mode;
int clamp_layer;
float blend_opacity;
diff --git a/source/blender/draw/engines/gpencil/gpencil_render.c b/source/blender/draw/engines/gpencil/gpencil_render.c
index 41c9ef0a177..7d5d7cfab0b 100644
--- a/source/blender/draw/engines/gpencil/gpencil_render.c
+++ b/source/blender/draw/engines/gpencil/gpencil_render.c
@@ -346,7 +346,7 @@ void GPENCIL_render_to_image(void *vedata,
if (gp_pixel_rgba[3] > 0.0f) {
if (src_pixel_rgba[3] > 0.0f) {
/* if depth enabled, then check z-depth */
- if (!stl->storage->no_depth_composition && gp_pixel_depth[0] > src_pixel_depth[0]) {
+ if (gp_pixel_depth[0] > src_pixel_depth[0]) {
/* copy source z-depth */
gp_pixel_depth[0] = src_pixel_depth[0];
/* blend object on top */
diff --git a/source/blender/draw/engines/lanpr/lanpr_access.c b/source/blender/draw/engines/lanpr/lanpr_access.c
index 8f1b4670c94..524a08eacd5 100644
--- a/source/blender/draw/engines/lanpr/lanpr_access.c
+++ b/source/blender/draw/engines/lanpr/lanpr_access.c
@@ -268,7 +268,7 @@ void lanpr_generate_gpencil_from_chain(
float *stroke_data = BLI_array_alloca(stroke_data, count * GP_PRIM_DATABUF_SIZE);
for (rlci = rlc->chain.first; rlci; rlci = (LANPR_RenderLineChainItem *)rlci->item.next) {
- float opatity = rlci->occlusion ? 0.1f : 1.0f;
+ float opatity = rlci->occlusion ? 0.0f : 1.0f;
stroke_data[array_idx] = rlci->gpos[0];
stroke_data[array_idx + 1] = rlci->gpos[1];
stroke_data[array_idx + 2] = rlci->gpos[2];
diff --git a/source/blender/draw/engines/lanpr/lanpr_chain.c b/source/blender/draw/engines/lanpr/lanpr_chain.c
index 0ce4a3d216d..a648bccb58d 100644
--- a/source/blender/draw/engines/lanpr/lanpr_chain.c
+++ b/source/blender/draw/engines/lanpr/lanpr_chain.c
@@ -407,7 +407,7 @@ void lanpr_NO_THREAD_chain_feature_lines(LANPR_RenderBuffer *rb, float dist_thre
new_rl->r->gloc[2],
N,
new_rl->flags,
- 0);
+ 100);
}
ba = lanpr_get_point_bounding_area(rb, new_rv->fbcoord[0], new_rv->fbcoord[1]);
}
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index e1e586bb232..3c21e7a5b6c 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -467,11 +467,7 @@ typedef struct bGPdata {
ListBase layers;
/** Settings for this datablock. */
int flag;
-
- /** Not composite depth when drawing the layer*/
- int no_depth;
-
- // char _pad1[4];
+ char _pad1[4];
/* Palettes */
/** List of bGPDpalette's - Deprecated (2.78 - 2.79 only). */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 6d57240ae4a..825ebe14fa8 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1658,14 +1658,7 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
RNA_def_property_collection_funcs(
prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
-
- /* composition Depth */
- prop = RNA_def_property(srna, "disable_depth_composition", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "no_depth", 0);
- RNA_def_property_ui_text(
- prop, "Disable Depth Composition", "Do not use depth when rendering GPencil to 3D scene.");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
-
+
/* Depth */
prop = RNA_def_property(srna, "stroke_depth_order", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "draw_mode");
More information about the Bf-blender-cvs
mailing list