Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/gpencil/gpencil_engine.h
| Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
| #define GP_LIGHT_TYPE_POINT 0.0 | #define GP_LIGHT_TYPE_POINT 0.0 | ||||
| #define GP_LIGHT_TYPE_SPOT 1.0 | #define GP_LIGHT_TYPE_SPOT 1.0 | ||||
| #define GP_LIGHT_TYPE_SUN 2.0 | #define GP_LIGHT_TYPE_SUN 2.0 | ||||
| #define GP_LIGHT_TYPE_AMBIENT 3.0 | #define GP_LIGHT_TYPE_AMBIENT 3.0 | ||||
| BLI_STATIC_ASSERT_ALIGN(gpMaterial, 16) | BLI_STATIC_ASSERT_ALIGN(gpMaterial, 16) | ||||
| BLI_STATIC_ASSERT_ALIGN(gpLight, 16) | BLI_STATIC_ASSERT_ALIGN(gpLight, 16) | ||||
| typedef enum GPENCIL_AntiAliasingMode { | |||||
| GPENCIL_AA_MODE_SIMPLIFIED, | |||||
| GPENCIL_AA_MODE_SMAA, | |||||
| GPENCIL_AA_MODE_TAA | |||||
| } GPENCIL_AntiAliasingMode; | |||||
| /* *********** Draw Datas *********** */ | /* *********** Draw Datas *********** */ | ||||
| typedef struct GPENCIL_MaterialPool { | typedef struct GPENCIL_MaterialPool { | ||||
| /* Linklist. */ | /* Linklist. */ | ||||
| struct GPENCIL_MaterialPool *next; | struct GPENCIL_MaterialPool *next; | ||||
| /* GPU representation of materials. */ | /* GPU representation of materials. */ | ||||
| gpMaterial mat_data[GP_MATERIAL_BUFFER_LEN]; | gpMaterial mat_data[GP_MATERIAL_BUFFER_LEN]; | ||||
| /* Matching ubo. */ | /* Matching ubo. */ | ||||
| struct GPUUniformBuf *ubo; | struct GPUUniformBuf *ubo; | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | typedef struct GPENCIL_PassList { | ||||
| /* Composite the object depth to the default depth buffer to occlude overlays. */ | /* Composite the object depth to the default depth buffer to occlude overlays. */ | ||||
| struct DRWPass *merge_depth_ps; | struct DRWPass *merge_depth_ps; | ||||
| /* Invert mask buffer content. */ | /* Invert mask buffer content. */ | ||||
| struct DRWPass *mask_invert_ps; | struct DRWPass *mask_invert_ps; | ||||
| /* Anti-Aliasing. */ | /* Anti-Aliasing. */ | ||||
| struct DRWPass *smaa_edge_ps; | struct DRWPass *smaa_edge_ps; | ||||
| struct DRWPass *smaa_weight_ps; | struct DRWPass *smaa_weight_ps; | ||||
| struct DRWPass *smaa_resolve_ps; | struct DRWPass *smaa_resolve_ps; | ||||
| struct DRWPass *taa_accum_ps; | |||||
| struct DRWPass *taa_accum_replace_ps; | |||||
| struct DRWPass *taa_resolve_ps; | |||||
| } GPENCIL_PassList; | } GPENCIL_PassList; | ||||
| typedef struct GPENCIL_FramebufferList { | typedef struct GPENCIL_FramebufferList { | ||||
| struct GPUFrameBuffer *render_fb; | struct GPUFrameBuffer *render_fb; | ||||
| struct GPUFrameBuffer *gpencil_fb; | struct GPUFrameBuffer *gpencil_fb; | ||||
| struct GPUFrameBuffer *snapshot_fb; | struct GPUFrameBuffer *snapshot_fb; | ||||
| struct GPUFrameBuffer *layer_fb; | struct GPUFrameBuffer *layer_fb; | ||||
| struct GPUFrameBuffer *object_fb; | struct GPUFrameBuffer *object_fb; | ||||
| struct GPUFrameBuffer *mask_fb; | struct GPUFrameBuffer *mask_fb; | ||||
| struct GPUFrameBuffer *smaa_edge_fb; | struct GPUFrameBuffer *smaa_edge_fb; | ||||
| struct GPUFrameBuffer *smaa_weight_fb; | struct GPUFrameBuffer *smaa_weight_fb; | ||||
| struct GPUFrameBuffer *antialiasing_fb; | |||||
| } GPENCIL_FramebufferList; | } GPENCIL_FramebufferList; | ||||
| typedef struct GPENCIL_TextureList { | typedef struct GPENCIL_TextureList { | ||||
| /* Dummy texture to avoid errors cause by empty sampler. */ | /* Dummy texture to avoid errors cause by empty sampler. */ | ||||
| struct GPUTexture *dummy_texture; | struct GPUTexture *dummy_texture; | ||||
| /* Snapshot for smoother drawing. */ | /* Snapshot for smoother drawing. */ | ||||
| struct GPUTexture *snapshot_depth_tx; | struct GPUTexture *snapshot_depth_tx; | ||||
| struct GPUTexture *snapshot_color_tx; | struct GPUTexture *snapshot_color_tx; | ||||
| struct GPUTexture *snapshot_reveal_tx; | struct GPUTexture *snapshot_reveal_tx; | ||||
| /* Textures used by Antialiasing. */ | /* Textures used by Antialiasing. */ | ||||
| struct GPUTexture *smaa_area_tx; | struct GPUTexture *smaa_area_tx; | ||||
| struct GPUTexture *smaa_search_tx; | struct GPUTexture *smaa_search_tx; | ||||
| struct GPUTexture *history_buffer_tx; | |||||
| struct GPUTexture *depth_buffer_tx; | |||||
| struct GPUTexture *final_depth_buffer_tx; | |||||
| /* Textures used during render. Containing underlying rendered scene. */ | /* Textures used during render. Containing underlying rendered scene. */ | ||||
| struct GPUTexture *render_depth_tx; | struct GPUTexture *render_depth_tx; | ||||
| struct GPUTexture *render_color_tx; | struct GPUTexture *render_color_tx; | ||||
| } GPENCIL_TextureList; | } GPENCIL_TextureList; | ||||
| typedef struct GPENCIL_Data { | typedef struct GPENCIL_Data { | ||||
| void *engine_type; /* Required */ | void *engine_type; /* Required */ | ||||
| struct GPENCIL_FramebufferList *fbl; | struct GPENCIL_FramebufferList *fbl; | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | typedef struct GPENCIL_PrivateData { | ||||
| /* Display onion skinning */ | /* Display onion skinning */ | ||||
| bool do_onion; | bool do_onion; | ||||
| /* Playing animation */ | /* Playing animation */ | ||||
| bool playing; | bool playing; | ||||
| /* simplify settings */ | /* simplify settings */ | ||||
| bool simplify_fill; | bool simplify_fill; | ||||
| bool simplify_fx; | bool simplify_fx; | ||||
| bool simplify_antialias; | |||||
| /* Use scene lighting or flat shading (global setting). */ | /* Use scene lighting or flat shading (global setting). */ | ||||
| bool use_lighting; | bool use_lighting; | ||||
| /* Use physical lights or just ambient lighting. */ | /* Use physical lights or just ambient lighting. */ | ||||
| bool use_lights; | bool use_lights; | ||||
| /* Do we need additional frame-buffers? */ | /* Do we need additional frame-buffers? */ | ||||
| bool use_layer_fb; | bool use_layer_fb; | ||||
| bool use_object_fb; | bool use_object_fb; | ||||
| bool use_mask_fb; | bool use_mask_fb; | ||||
| Show All 11 Lines | typedef struct GPENCIL_PrivateData { | ||||
| /* Mask opacity uniform. */ | /* Mask opacity uniform. */ | ||||
| float mask_opacity; | float mask_opacity; | ||||
| /* Xray transparency in solid mode. */ | /* Xray transparency in solid mode. */ | ||||
| float xray_alpha; | float xray_alpha; | ||||
| /* Mask invert uniform. */ | /* Mask invert uniform. */ | ||||
| int mask_invert; | int mask_invert; | ||||
| /* Vertex Paint opacity. */ | /* Vertex Paint opacity. */ | ||||
| float vertex_paint_opacity; | float vertex_paint_opacity; | ||||
| /* Anti-aliasing. */ | |||||
| GPENCIL_AntiAliasingMode anti_aliasing_mode; | |||||
| /** Total number of samples to after which TAA stops accumulating samples. */ | |||||
| int taa_sample_len; | |||||
| /** Current TAA sample index in [0..taa_sample_len[ range. */ | |||||
| int taa_sample; | |||||
| /** Weight accumulated. */ | |||||
| float taa_weight_accum; | |||||
| /** Samples weight for this iteration. */ | |||||
| float taa_weights[9]; | |||||
| /** Sum of taa_weights. */ | |||||
| float taa_weights_sum; | |||||
| /** View */ | |||||
| struct DRWView *view; | |||||
| } GPENCIL_PrivateData; | } GPENCIL_PrivateData; | ||||
| /* geometry batch cache functions */ | /* geometry batch cache functions */ | ||||
| struct GpencilBatchCache *gpencil_batch_cache_get(struct Object *ob, int cfra); | struct GpencilBatchCache *gpencil_batch_cache_get(struct Object *ob, int cfra); | ||||
| GPENCIL_tObject *gpencil_object_cache_add(GPENCIL_PrivateData *pd, Object *ob); | GPENCIL_tObject *gpencil_object_cache_add(GPENCIL_PrivateData *pd, Object *ob); | ||||
| void gpencil_object_cache_sort(GPENCIL_PrivateData *pd); | void gpencil_object_cache_sort(GPENCIL_PrivateData *pd); | ||||
| Show All 16 Lines | |||||
| GPENCIL_LightPool *gpencil_light_pool_add(GPENCIL_PrivateData *pd); | GPENCIL_LightPool *gpencil_light_pool_add(GPENCIL_PrivateData *pd); | ||||
| GPENCIL_LightPool *gpencil_light_pool_create(GPENCIL_PrivateData *pd, Object *ob); | GPENCIL_LightPool *gpencil_light_pool_create(GPENCIL_PrivateData *pd, Object *ob); | ||||
| /* effects */ | /* effects */ | ||||
| void gpencil_vfx_cache_populate(GPENCIL_Data *vedata, Object *ob, GPENCIL_tObject *tgp_ob); | void gpencil_vfx_cache_populate(GPENCIL_Data *vedata, Object *ob, GPENCIL_tObject *tgp_ob); | ||||
| /* Shaders */ | /* Shaders */ | ||||
| struct GPUShader *GPENCIL_shader_antialiasing(int stage); | struct GPUShader *GPENCIL_shader_antialiasing(int stage); | ||||
| struct GPUShader *GPENCIL_shader_antialiasing_accumulation_get(void); | |||||
| struct GPUShader *GPENCIL_shader_antialiasing_resolve_get(void); | |||||
| struct GPUShader *GPENCIL_shader_geometry_get(void); | struct GPUShader *GPENCIL_shader_geometry_get(void); | ||||
| struct GPUShader *GPENCIL_shader_layer_blend_get(void); | struct GPUShader *GPENCIL_shader_layer_blend_get(void); | ||||
| struct GPUShader *GPENCIL_shader_mask_invert_get(void); | struct GPUShader *GPENCIL_shader_mask_invert_get(void); | ||||
| struct GPUShader *GPENCIL_shader_depth_merge_get(void); | struct GPUShader *GPENCIL_shader_depth_merge_get(void); | ||||
| struct GPUShader *GPENCIL_shader_fx_blur_get(void); | struct GPUShader *GPENCIL_shader_fx_blur_get(void); | ||||
| struct GPUShader *GPENCIL_shader_fx_colorize_get(void); | struct GPUShader *GPENCIL_shader_fx_colorize_get(void); | ||||
| struct GPUShader *GPENCIL_shader_fx_composite_get(void); | struct GPUShader *GPENCIL_shader_fx_composite_get(void); | ||||
| struct GPUShader *GPENCIL_shader_fx_transform_get(void); | struct GPUShader *GPENCIL_shader_fx_transform_get(void); | ||||
| struct GPUShader *GPENCIL_shader_fx_glow_get(void); | struct GPUShader *GPENCIL_shader_fx_glow_get(void); | ||||
| struct GPUShader *GPENCIL_shader_fx_pixelize_get(void); | struct GPUShader *GPENCIL_shader_fx_pixelize_get(void); | ||||
| struct GPUShader *GPENCIL_shader_fx_rim_get(void); | struct GPUShader *GPENCIL_shader_fx_rim_get(void); | ||||
| struct GPUShader *GPENCIL_shader_fx_shadow_get(void); | struct GPUShader *GPENCIL_shader_fx_shadow_get(void); | ||||
| void GPENCIL_shader_free(void); | void GPENCIL_shader_free(void); | ||||
| /* Antialiasing */ | /* Antialiasing */ | ||||
| void GPENCIL_antialiasing_init(struct GPENCIL_Data *vedata); | void GPENCIL_antialiasing_init(struct GPENCIL_Data *vedata); | ||||
| void GPENCIL_antialiasing_draw(struct GPENCIL_Data *vedata); | void GPENCIL_antialiasing_draw(struct GPENCIL_Data *vedata); | ||||
| void GPENCIL_antialiasing_setup(struct GPENCIL_Data *vedata); | |||||
| int GPENCIL_antialiasing_sample_count_get(GPENCIL_PrivateData *pd); | |||||
| /* main functions */ | /* main functions */ | ||||
| void GPENCIL_engine_init(void *vedata); | void GPENCIL_engine_init(void *vedata); | ||||
| void GPENCIL_cache_init(void *vedata); | void GPENCIL_cache_init(void *vedata); | ||||
| void GPENCIL_cache_populate(void *vedata, struct Object *ob); | void GPENCIL_cache_populate(void *vedata, struct Object *ob); | ||||
| void GPENCIL_cache_finish(void *vedata); | void GPENCIL_cache_finish(void *vedata); | ||||
| void GPENCIL_draw_scene(void *vedata); | void GPENCIL_draw_scene(void *vedata); | ||||
| Show All 18 Lines | |||||