Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/gpencil/gpencil_engine.c
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
| extern char datatoc_gpencil_point_frag_glsl[]; | extern char datatoc_gpencil_point_frag_glsl[]; | ||||
| extern char datatoc_gpencil_background_frag_glsl[]; | extern char datatoc_gpencil_background_frag_glsl[]; | ||||
| extern char datatoc_gpencil_paper_frag_glsl[]; | extern char datatoc_gpencil_paper_frag_glsl[]; | ||||
| extern char datatoc_gpencil_edit_point_vert_glsl[]; | extern char datatoc_gpencil_edit_point_vert_glsl[]; | ||||
| extern char datatoc_gpencil_edit_point_geom_glsl[]; | extern char datatoc_gpencil_edit_point_geom_glsl[]; | ||||
| extern char datatoc_gpencil_edit_point_frag_glsl[]; | extern char datatoc_gpencil_edit_point_frag_glsl[]; | ||||
| extern char datatoc_gpencil_blend_frag_glsl[]; | extern char datatoc_gpencil_blend_frag_glsl[]; | ||||
| extern char datatoc_common_colormanagement_lib_glsl[]; | |||||
| extern char datatoc_common_view_lib_glsl[]; | extern char datatoc_common_view_lib_glsl[]; | ||||
| /* *********** STATIC *********** */ | /* *********** STATIC *********** */ | ||||
| static GPENCIL_e_data e_data = {NULL}; /* Engine data */ | static GPENCIL_e_data e_data = {NULL}; /* Engine data */ | ||||
| /* *********** FUNCTIONS *********** */ | /* *********** FUNCTIONS *********** */ | ||||
| /* create a multisample buffer if not present */ | /* create a multisample buffer if not present */ | ||||
| ▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | if (DRW_state_is_fbo()) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void GPENCIL_create_shaders(void) | static void GPENCIL_create_shaders(void) | ||||
| { | { | ||||
| /* normal fill shader */ | /* normal fill shader */ | ||||
| if (!e_data.gpencil_fill_sh) { | if (!e_data.gpencil_fill_sh) { | ||||
| e_data.gpencil_fill_sh = DRW_shader_create_with_lib(datatoc_gpencil_fill_vert_glsl, | e_data.gpencil_fill_sh = GPU_shader_create_from_arrays({ | ||||
| NULL, | .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, | datatoc_gpencil_fill_frag_glsl, | ||||
| datatoc_common_view_lib_glsl, | NULL}, | ||||
| NULL); | }); | ||||
| } | } | ||||
| /* normal stroke shader using geometry to display lines (line mode) */ | /* normal stroke shader using geometry to display lines (line mode) */ | ||||
| if (!e_data.gpencil_stroke_sh) { | if (!e_data.gpencil_stroke_sh) { | ||||
| e_data.gpencil_stroke_sh = DRW_shader_create_with_lib(datatoc_gpencil_stroke_vert_glsl, | e_data.gpencil_stroke_sh = GPU_shader_create_from_arrays({ | ||||
| datatoc_gpencil_stroke_geom_glsl, | .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, | datatoc_gpencil_stroke_frag_glsl, | ||||
| datatoc_common_view_lib_glsl, | NULL}, | ||||
| NULL); | }); | ||||
| } | } | ||||
| /* dot/rectangle mode for normal strokes using geometry */ | /* dot/rectangle mode for normal strokes using geometry */ | ||||
| if (!e_data.gpencil_point_sh) { | if (!e_data.gpencil_point_sh) { | ||||
| e_data.gpencil_point_sh = DRW_shader_create_with_lib(datatoc_gpencil_point_vert_glsl, | e_data.gpencil_point_sh = GPU_shader_create_from_arrays({ | ||||
| datatoc_gpencil_point_geom_glsl, | .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, | datatoc_gpencil_point_frag_glsl, | ||||
| datatoc_common_view_lib_glsl, | NULL}, | ||||
| NULL); | }); | ||||
| } | } | ||||
| /* used for edit points or strokes with one point only */ | /* used for edit points or strokes with one point only */ | ||||
| if (!e_data.gpencil_edit_point_sh) { | if (!e_data.gpencil_edit_point_sh) { | ||||
| e_data.gpencil_edit_point_sh = DRW_shader_create_with_lib(datatoc_gpencil_edit_point_vert_glsl, | e_data.gpencil_edit_point_sh = DRW_shader_create_with_lib(datatoc_gpencil_edit_point_vert_glsl, | ||||
| datatoc_gpencil_edit_point_geom_glsl, | datatoc_gpencil_edit_point_geom_glsl, | ||||
| datatoc_gpencil_edit_point_frag_glsl, | datatoc_gpencil_edit_point_frag_glsl, | ||||
| datatoc_common_view_lib_glsl, | datatoc_common_view_lib_glsl, | ||||
| NULL); | NULL); | ||||
| ▲ Show 20 Lines • Show All 897 Lines • Show Last 20 Lines | |||||