|
Blender V4.3
|
#include <workbench_private.hh>
Public Member Functions | |
| AntiAliasingPass () | |
| void | init (const SceneState &scene_state) |
| void | sync (const SceneState &scene_state, SceneResources &resources) |
| void | setup_view (View &view, const SceneState &scene_state) |
| void | draw (Manager &manager, View &view, const SceneState &scene_state, SceneResources &resources, GPUTexture *depth_in_front_tx) |
Definition at line 559 of file workbench_private.hh.
| blender::workbench::AntiAliasingPass::AntiAliasingPass | ( | ) |
Definition at line 112 of file workbench_effect_antialiasing.cc.
References AREATEX_HEIGHT, AREATEX_WIDTH, areaTexBytes, blender::draw::Texture::ensure_2d(), GPU_DATA_UBYTE, GPU_R8, GPU_RG8, GPU_texture_filter_mode(), GPU_texture_update(), GPU_TEXTURE_USAGE_SHADER_READ, SEARCHTEX_HEIGHT, SEARCHTEX_WIDTH, and searchTexBytes.
| void blender::workbench::AntiAliasingPass::draw | ( | Manager & | manager, |
| View & | view, | ||
| const SceneState & | scene_state, | ||
| SceneResources & | resources, | ||
| GPUTexture * | depth_in_front_tx ) |
We always do SMAA on top of TAA accumulation, unless the number of samples of TAA is already high. This ensure a smoother transition. If TAA accumulation is finished, we only blit the result.
Always acquire to avoid constant allocation/deallocation.
| depth_in_front_tx | Passed directly since we may need to copy back the results from the first sample, and resources.depth_in_front_tx is only valid when mesh passes have to draw to it. |
Definition at line 240 of file workbench_effect_antialiasing.cc.
References blender::draw::TextureFromPool::acquire(), blender::draw::Framebuffer::bind(), blender::workbench::SceneResources::color_tx, blender::workbench::SceneResources::depth_in_front_tx, blender::workbench::SceneResources::depth_tx, DRW_state_is_image_render(), DRW_state_is_scene_render(), blender::draw::Framebuffer::ensure(), blender::draw::Texture::ensure_2d(), blender::draw::Texture::free(), GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE, GPU_DEPTH24_STENCIL8, GPU_RG8, GPU_RGBA8, GPU_texture_copy(), GPU_TEXTURE_USAGE_ATTACHMENT, GPU_TEXTURE_USAGE_SHADER_READ, blender::draw::Texture::is_valid(), blender::draw::TextureFromPool::release(), blender::workbench::SceneState::resolution, blender::workbench::SceneState::sample, blender::workbench::SceneState::samples_len, and blender::draw::Manager::submit().
Referenced by blender::workbench::Instance::draw().
| void blender::workbench::AntiAliasingPass::init | ( | const SceneState & | scene_state | ) |
Definition at line 124 of file workbench_effect_antialiasing.cc.
References blender::workbench::SceneState::draw_aa.
Referenced by blender::workbench::Instance::init().
| void blender::workbench::AntiAliasingPass::setup_view | ( | View & | view, |
| const SceneState & | scene_state ) |
Definition at line 194 of file workbench_effect_antialiasing.cc.
References DRW_view_default_get(), DRW_view_persmat_get(), DRW_view_viewmat_get(), DRW_view_winmat_get(), blender::workbench::get_taa_samples(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), blender::workbench::SceneState::resolution, blender::workbench::SceneState::sample, blender::workbench::SceneState::samples_len, blender::workbench::setup_taa_weights(), window_translate_m4(), blender::workbench::TaaSamples::x11, blender::workbench::TaaSamples::x16, blender::workbench::TaaSamples::x32, blender::workbench::TaaSamples::x5, and blender::workbench::TaaSamples::x8.
Referenced by blender::workbench::Instance::draw().
| void blender::workbench::AntiAliasingPass::sync | ( | const SceneState & | scene_state, |
| SceneResources & | resources ) |
Definition at line 129 of file workbench_effect_antialiasing.cc.
References blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), clamp_f(), blender::draw::detail::PassBase< DrawCommandBufType >::clear_color(), blender::workbench::SceneResources::color_tx, blender::draw::detail::PassBase< DrawCommandBufType >::draw_procedural(), DRW_STATE_BLEND_ADD_FULL, DRW_STATE_DEPTH_ALWAYS, DRW_STATE_STENCIL_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, blender::draw::Texture::ensure_2d(), blender::draw::Texture::free(), blender::workbench::ShaderCache::get(), blender::workbench::StaticShader::get(), GPU_DEPTH24_STENCIL8, GPU_PRIM_TRIS, GPU_RGBA16F, GPU_TEXTURE_USAGE_ATTACHMENT, GPU_TEXTURE_USAGE_SHADER_READ, blender::draw::detail::Pass< DrawCommandBufType >::init(), blender::workbench::OBJECT_IN_FRONT, blender::draw::detail::PassBase< DrawCommandBufType >::push_constant(), blender::workbench::SceneState::resolution, blender::workbench::SceneState::sample, blender::draw::detail::PassBase< DrawCommandBufType >::shader_set(), blender::workbench::ShaderCache::smaa_aa_weight, blender::workbench::ShaderCache::smaa_edge_detect, blender::workbench::ShaderCache::smaa_resolve, blender::draw::detail::PassBase< DrawCommandBufType >::state_set(), blender::draw::detail::PassBase< DrawCommandBufType >::state_stencil(), and blender::workbench::ShaderCache::taa_accumulation.
Referenced by blender::workbench::Instance::begin_sync(), and blender::workbench::Instance::draw_image_render().