Blender
V3.3
|
Go to the source code of this file.
Functions | |
void | OVERLAY_antialiasing_init (OVERLAY_Data *vedata) |
void | OVERLAY_antialiasing_cache_init (OVERLAY_Data *vedata) |
void | OVERLAY_antialiasing_cache_finish (OVERLAY_Data *vedata) |
void | OVERLAY_antialiasing_start (OVERLAY_Data *vedata) |
void | OVERLAY_xray_depth_copy (OVERLAY_Data *vedata) |
void | OVERLAY_xray_depth_infront_copy (OVERLAY_Data *vedata) |
void | OVERLAY_xray_fade_draw (OVERLAY_Data *vedata) |
void | OVERLAY_antialiasing_end (OVERLAY_Data *vedata) |
Overlay antialiasing:
Most of the overlays are wires which causes a lot of flickering in motions due to aliasing problems.
Our goal is to have a technique that works with single sample per pixel to avoid extra cost of managing MSAA or additional texture buffers and jitters.
To solve this we use a simple and effective post-process AA. The technique goes like this:
This technique has one major shortcoming compared to MSAA:
The pros of this approach are many:
Definition in file overlay_antialiasing.c.
void OVERLAY_antialiasing_cache_finish | ( | OVERLAY_Data * | vedata | ) |
Definition at line 142 of file overlay_antialiasing.c.
References OVERLAY_PrivateData::antialiasing, OVERLAY_PrivateData::do_depth_copy, OVERLAY_PrivateData::do_depth_infront_copy, DRW_pass_is_empty(), DRW_texture_ensure_fullscreen_2d(), DRW_viewport_texture_list_get(), OVERLAY_PrivateData::enabled, OVERLAY_Data::fbl, GPU_DEPTH24_STENCIL8, NULL, OVERLAY_FramebufferList::overlay_in_front_fb, OVERLAY_FramebufferList::overlay_line_in_front_fb, OVERLAY_StorageList::pd, OVERLAY_Data::psl, OVERLAY_Data::stl, OVERLAY_TextureList::temp_depth_tx, OVERLAY_Data::txl, OVERLAY_PassList::wireframe_ps, OVERLAY_PassList::wireframe_xray_ps, OVERLAY_PrivateData::xray_enabled, and OVERLAY_PrivateData::xray_opacity.
Referenced by OVERLAY_cache_finish().
void OVERLAY_antialiasing_cache_init | ( | OVERLAY_Data * | vedata | ) |
Definition at line 103 of file overlay_antialiasing.c.
References OVERLAY_PrivateData::antialiasing, OVERLAY_PassList::antialiasing_ps, DRW_Global::block_ubo, DefaultTextureList::depth, DRW_PASS_CREATE, DRW_shgroup_call_procedural_triangles(), DRW_shgroup_create(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_bool_copy(), DRW_shgroup_uniform_float_copy(), DRW_shgroup_uniform_texture_ref(), DRW_STATE_BLEND_ALPHA_PREMUL, DRW_STATE_BLEND_MUL, DRW_STATE_WRITE_COLOR, DRW_viewport_texture_list_get(), OVERLAY_PrivateData::enabled, G_draw, NULL, OVERLAY_TextureList::overlay_color_tx, OVERLAY_TextureList::overlay_line_tx, OVERLAY_shader_antialiasing(), OVERLAY_shader_xray_fade(), OVERLAY_StorageList::pd, OVERLAY_Data::psl, sh, OVERLAY_Data::stl, OVERLAY_TextureList::temp_depth_tx, OVERLAY_Data::txl, USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE, OVERLAY_PrivateData::xray_enabled, OVERLAY_PassList::xray_fade_ps, and OVERLAY_PrivateData::xray_opacity.
Referenced by OVERLAY_cache_init().
void OVERLAY_antialiasing_end | ( | OVERLAY_Data * | vedata | ) |
Definition at line 245 of file overlay_antialiasing.c.
References OVERLAY_PrivateData::antialiasing, OVERLAY_PassList::antialiasing_ps, DRW_draw_pass(), DRW_viewport_framebuffer_list_get(), OVERLAY_PrivateData::enabled, GPU_framebuffer_bind(), DefaultFramebufferList::overlay_only_fb, OVERLAY_StorageList::pd, OVERLAY_Data::psl, and OVERLAY_Data::stl.
Referenced by OVERLAY_draw_scene().
void OVERLAY_antialiasing_init | ( | OVERLAY_Data * | vedata | ) |
Definition at line 48 of file overlay_antialiasing.c.
References OVERLAY_PrivateData::antialiasing, DRW_Global::block, DefaultTextureList::color_overlay, DRW_state_is_fbo(), DRW_TEX_FILTER, DRW_texture_create_2d(), DRW_texture_ensure_fullscreen_2d(), DRW_viewport_texture_list_get(), OVERLAY_TextureList::dummy_depth_tx, OVERLAY_PrivateData::enabled, OVERLAY_Data::fbl, G_draw, GPU_DEPTH_COMPONENT24, GPU_RGBA8, GPU_SRGB8_A8, NULL, OVERLAY_FramebufferList::overlay_color_only_fb, OVERLAY_TextureList::overlay_color_tx, OVERLAY_FramebufferList::overlay_default_fb, OVERLAY_FramebufferList::overlay_line_fb, OVERLAY_TextureList::overlay_line_tx, OVERLAY_StorageList::pd, GlobalsUboStorage::size_pixel, OVERLAY_Data::stl, OVERLAY_Data::txl, and USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE.
Referenced by OVERLAY_engine_init().
void OVERLAY_antialiasing_start | ( | OVERLAY_Data * | vedata | ) |
Definition at line 184 of file overlay_antialiasing.c.
References OVERLAY_PrivateData::antialiasing, OVERLAY_PrivateData::clear_in_front, DRW_state_is_fbo(), OVERLAY_PrivateData::enabled, OVERLAY_Data::fbl, GPU_framebuffer_bind(), OVERLAY_FramebufferList::overlay_in_front_fb, OVERLAY_FramebufferList::overlay_line_fb, OVERLAY_StorageList::pd, and OVERLAY_Data::stl.
Referenced by OVERLAY_draw_scene().
void OVERLAY_xray_depth_copy | ( | OVERLAY_Data * | vedata | ) |
Definition at line 203 of file overlay_antialiasing.c.
References OVERLAY_PrivateData::antialiasing, DefaultTextureList::depth, OVERLAY_PrivateData::do_depth_copy, DRW_state_is_fbo(), DRW_viewport_texture_list_get(), OVERLAY_Data::fbl, GPU_framebuffer_bind(), GPU_texture_copy(), OVERLAY_FramebufferList::overlay_default_fb, OVERLAY_StorageList::pd, OVERLAY_Data::stl, OVERLAY_TextureList::temp_depth_tx, OVERLAY_Data::txl, and OVERLAY_PrivateData::xray_enabled.
Referenced by OVERLAY_draw_scene().
void OVERLAY_xray_depth_infront_copy | ( | OVERLAY_Data * | vedata | ) |
Definition at line 222 of file overlay_antialiasing.c.
References OVERLAY_PrivateData::antialiasing, DefaultTextureList::depth_in_front, OVERLAY_PrivateData::do_depth_infront_copy, DRW_state_is_fbo(), DRW_viewport_texture_list_get(), GPU_texture_copy(), OVERLAY_StorageList::pd, OVERLAY_Data::stl, OVERLAY_TextureList::temp_depth_tx, and OVERLAY_Data::txl.
Referenced by OVERLAY_draw_scene().
void OVERLAY_xray_fade_draw | ( | OVERLAY_Data * | vedata | ) |
Definition at line 234 of file overlay_antialiasing.c.
References DRW_draw_pass(), DRW_state_is_fbo(), OVERLAY_StorageList::pd, OVERLAY_Data::psl, OVERLAY_Data::stl, OVERLAY_PrivateData::xray_enabled, OVERLAY_PassList::xray_fade_ps, and OVERLAY_PrivateData::xray_opacity.
Referenced by OVERLAY_draw_scene().