Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2019-04-02 17:05:22 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-06-21 10:53:51 +0300
commitfed6c1a970f1df14da7c5fd4dfaf84371efcbe5d (patch)
treecab4653b8d57d41bca6f1c45ef94b2601f8ea97c /source/blender/draw/engines/gpencil/gpencil_engine.c
parenta3a6cda8fb678432e0552d23b0226e8617f26e5f (diff)
Fix T62876: Camera Background Images
Migrate old legacy code to the draw mamager/object mode. The old legacy version did not work with wireframe. By migrating the code to modern draw manager code we have mode control on the drawing process. Still background images do not work with OIT, the cause seems to be that the transparent pixels are treated as background pixels. Also There are some artifacts when working with Holdouts and DoF, this is because the draw engines do not pass the correct alpha values. Reviewers: fclem, brecht Differential Revision: https://developer.blender.org/D4638
Diffstat (limited to 'source/blender/draw/engines/gpencil/gpencil_engine.c')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 6d1227bb0a8..ae3bf8cead6 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -61,6 +61,7 @@ extern char datatoc_gpencil_edit_point_geom_glsl[];
extern char datatoc_gpencil_edit_point_frag_glsl[];
extern char datatoc_gpencil_blend_frag_glsl[];
+extern char datatoc_common_colormanagement_lib_glsl[];
extern char datatoc_common_view_lib_glsl[];
/* *********** STATIC *********** */
@@ -169,29 +170,37 @@ static void GPENCIL_create_shaders(void)
{
/* normal fill shader */
if (!e_data.gpencil_fill_sh) {
- e_data.gpencil_fill_sh = DRW_shader_create_with_lib(datatoc_gpencil_fill_vert_glsl,
- NULL,
- datatoc_gpencil_fill_frag_glsl,
- datatoc_common_view_lib_glsl,
- NULL);
+ e_data.gpencil_fill_sh = GPU_shader_create_from_arrays({
+ .vert =
+ (const char *[]){datatoc_common_view_lib_glsl, datatoc_gpencil_fill_vert_glsl, NULL},
+ .frag = (const char *[]){datatoc_common_colormanagement_lib_glsl,
+ datatoc_gpencil_fill_frag_glsl,
+ NULL},
+ });
}
/* normal stroke shader using geometry to display lines (line mode) */
if (!e_data.gpencil_stroke_sh) {
- e_data.gpencil_stroke_sh = DRW_shader_create_with_lib(datatoc_gpencil_stroke_vert_glsl,
- datatoc_gpencil_stroke_geom_glsl,
- datatoc_gpencil_stroke_frag_glsl,
- datatoc_common_view_lib_glsl,
- NULL);
+ e_data.gpencil_stroke_sh = GPU_shader_create_from_arrays({
+ .vert =
+ (const char *[]){datatoc_common_view_lib_glsl, datatoc_gpencil_stroke_vert_glsl, NULL},
+ .geom = (const char *[]){datatoc_gpencil_stroke_geom_glsl, NULL},
+ .frag = (const char *[]){datatoc_common_colormanagement_lib_glsl,
+ datatoc_gpencil_stroke_frag_glsl,
+ NULL},
+ });
}
/* dot/rectangle mode for normal strokes using geometry */
if (!e_data.gpencil_point_sh) {
- e_data.gpencil_point_sh = DRW_shader_create_with_lib(datatoc_gpencil_point_vert_glsl,
- datatoc_gpencil_point_geom_glsl,
- datatoc_gpencil_point_frag_glsl,
- datatoc_common_view_lib_glsl,
- NULL);
+ e_data.gpencil_point_sh = GPU_shader_create_from_arrays({
+ .vert =
+ (const char *[]){datatoc_common_view_lib_glsl, datatoc_gpencil_point_vert_glsl, NULL},
+ .geom = (const char *[]){datatoc_gpencil_point_geom_glsl, NULL},
+ .frag = (const char *[]){datatoc_common_colormanagement_lib_glsl,
+ datatoc_gpencil_point_frag_glsl,
+ NULL},
+ });
}
/* used for edit points or strokes with one point only */
if (!e_data.gpencil_edit_point_sh) {