Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/gpencil/gpencil_engine.h
| Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | |||||
| typedef struct GPENCIL_PassList { | typedef struct GPENCIL_PassList { | ||||
| /* Composite the main GPencil buffer onto the rendered image. */ | /* Composite the main GPencil buffer onto the rendered image. */ | ||||
| struct DRWPass *composite_ps; | struct DRWPass *composite_ps; | ||||
| /* 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 *aa_accum_ps; | |||||
| struct DRWPass *aa_accum_replace_ps; | |||||
| 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; | ||||
| } 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 *antialiasing_fb; | |||||
| struct GPUFrameBuffer *antialiasing_in_front_fb; | |||||
| struct GPUFrameBuffer *smaa_edge_fb; | struct GPUFrameBuffer *smaa_edge_fb; | ||||
| struct GPUFrameBuffer *smaa_weight_fb; | struct GPUFrameBuffer *smaa_weight_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_in_front_tx; | |||||
| struct GPUTexture *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 All 32 Lines | typedef struct GPENCIL_PrivateData { | ||||
| GPUTexture *reveal_tx; | GPUTexture *reveal_tx; | ||||
| GPUTexture *reveal_layer_tx; | GPUTexture *reveal_layer_tx; | ||||
| GPUTexture *reveal_object_tx; | GPUTexture *reveal_object_tx; | ||||
| /* Mask texture */ | /* Mask texture */ | ||||
| GPUTexture *mask_tx; | GPUTexture *mask_tx; | ||||
| /* Anti-Aliasing. */ | /* Anti-Aliasing. */ | ||||
| GPUTexture *smaa_edge_tx; | GPUTexture *smaa_edge_tx; | ||||
| GPUTexture *smaa_weight_tx; | GPUTexture *smaa_weight_tx; | ||||
| /** Weight of the smaa pass. */ | |||||
| float smaa_mix_factor; | |||||
| /* Pointer to dtxl->depth */ | /* Pointer to dtxl->depth */ | ||||
| GPUTexture *scene_depth_tx; | GPUTexture *scene_depth_tx; | ||||
| GPUFrameBuffer *scene_fb; | GPUFrameBuffer *scene_fb; | ||||
| /* Copy of txl->dummy_tx */ | /* Copy of txl->dummy_tx */ | ||||
| GPUTexture *dummy_tx; | GPUTexture *dummy_tx; | ||||
| /* Copy of v3d->shading.single_color. */ | /* Copy of v3d->shading.single_color. */ | ||||
| float v3d_single_color[3]; | float v3d_single_color[3]; | ||||
| /* Copy of v3d->shading.color_type or -1 to ignore. */ | /* Copy of v3d->shading.color_type or -1 to ignore. */ | ||||
| int v3d_color_type; | int v3d_color_type; | ||||
| /* Current frame */ | /* Current frame */ | ||||
| int cfra; | int cfra; | ||||
| /* If we are rendering for final render (F12). */ | /* If we are rendering for final render (F12). */ | ||||
| bool is_render; | bool is_render; | ||||
| /* If we are in viewport display (used for VFX). */ | /* If we are in viewport display (used for VFX). */ | ||||
| bool is_viewport; | bool is_viewport; | ||||
| /* Is animation playback active. */ | |||||
| bool is_playback; | |||||
| /* Is user navigating. */ | |||||
| bool is_navigating; | |||||
| /* True in selection and auto_depth drawing */ | /* True in selection and auto_depth drawing */ | ||||
| bool draw_depth_only; | bool draw_depth_only; | ||||
| /* Is shading set to wireframe. */ | /* Is shading set to wireframe. */ | ||||
| bool draw_wireframe; | bool draw_wireframe; | ||||
| /* Used by the depth merge step. */ | /* Used by the depth merge step. */ | ||||
| int is_stroke_order_3d; | int is_stroke_order_3d; | ||||
| float object_bound_mat[4][4]; | float object_bound_mat[4][4]; | ||||
| /* Used for computing object distance to camera. */ | /* Used for computing object distance to camera. */ | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 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; | ||||
| /* Temporal Antialiasing */ | |||||
| /** Total number of samples to after which TAA stops accumulating samples. */ | |||||
| int taa_sample_len; | |||||
| /** Total number of samples of the previous TAA. When changed TAA will be reset. */ | |||||
| int taa_sample_len_previous; | |||||
| /** 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; | |||||
| /** If the view has been updated and TAA needs to be reset. */ | |||||
| bool view_updated; | |||||
| /** True if the history buffer contains relevant data and false if it could contain garbage. */ | |||||
| bool valid_history; | |||||
| /** View */ | |||||
| struct DRWView *view; | |||||
| /** Last projection matrix to see if view is still valid. */ | |||||
| float last_mat[4][4]; | |||||
| /** Should we reset the next TAA sample. */ | |||||
| bool reset_next_sample; | |||||
| } 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_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_engine_init(struct GPENCIL_Data *vedata); | ||||
| void GPENCIL_antialiasing_draw(struct GPENCIL_Data *vedata); | void GPENCIL_antialiasing_cache_finish(GPENCIL_Data *vedata); | ||||
| bool GPENCIL_antialiasing_setup(GPENCIL_Data *vedata); | |||||
| void GPENCIL_antialiasing_draw(GPENCIL_Data *vedata); | |||||
| int GPENCIL_antialiasing_sample_count_get(GPENCIL_PrivateData *pd); | |||||
| void GPENCIL_antialiasing_view_updated(GPENCIL_Data *vedata); | |||||
| /* 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 | |||||