Blender V4.3
blender::workbench::AntiAliasingPass Class Reference

#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)
 

Detailed Description

Definition at line 559 of file workbench_private.hh.

Constructor & Destructor Documentation

◆ AntiAliasingPass()

Member Function Documentation

◆ draw()

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.

Parameters
depth_in_front_txPassed 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().

◆ init()

void blender::workbench::AntiAliasingPass::init ( const SceneState & scene_state)

◆ setup_view()

◆ sync()

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().


The documentation for this class was generated from the following files: