Toast Engine
Loading...
Searching...
No Matches
renderer::VoxelPass Class Reference

Deferred so lighting runs once per visible voxel pixel not once per march. More...

#include <voxel_pass.hpp>

Inheritance diagram for renderer::VoxelPass:
Collaboration diagram for renderer::VoxelPass:

Public Member Functions

 VoxelPass (const VulkanCore &core, vk::Format scene_format, vk::Format depth_format, vk::Extent2D extent)
auto stage () const -> RenderStage override
auto prepare (uint32_t frame_index) -> bool
void recordCellCull (vk::CommandBuffer cmd, uint32_t frame_index, vk::Extent2D scene_extent)
 Outside any rendering scope after prepare() and before record().
void record (vk::CommandBuffer cmd, uint32_t frame_index, uint32_t image_index) override
 Inside the voxel G-buffer scope after prepare() for everything the previous pyramid did not hide.
auto occlusionActive () const -> bool
 The renderer then runs recordOcclusion() and a second G-buffer scope for recordLate().
void recordOcclusion (vk::CommandBuffer cmd, uint32_t frame_index, vk::Extent2D scene_extent)
 Outside any rendering scope with depth in depth_sampled.
void recordLate (vk::CommandBuffer cmd, uint32_t frame_index)
 Inside a G-buffer scope that loads the early draws.
auto nearQuadDepthPass () const -> bool
 A depth only scope for recordQuadDepth() precedes each G-buffer scope except on the mesh shader path.
void recordQuadDepth (vk::CommandBuffer cmd, uint32_t frame_index, bool late)
 Inside a depth only scope before the G-buffer scope that shades the same quads.
void recordLighting (vk::CommandBuffer cmd, uint32_t frame_index, vk::Extent2D viewport)
 Writes scene colour indirect and rounded normal while reading the G-buffer and depth.
void onTargetsRecreated ()
 After the G-buffer and depth targets are recreated since a new view can reuse a destroyed handle value.
auto name () const -> std::string_view override
Public Member Functions inherited from IRenderPass
virtual void update (uint32_t frame_index, float dt)
virtual void recordPre (vk::CommandBuffer cmd, uint32_t frame_index, uint32_t image_index)
 Records outside any rendering scope before the main scope opens.
void setEnabled (bool enabled) noexcept
auto isEnabled () const noexcept -> bool

Static Public Attributes

static constexpr uint32_t k_max_instances = 4096

Detailed Description

Deferred so lighting runs once per visible voxel pixel not once per march.

Member Function Documentation

◆ name()

auto renderer::VoxelPass::name ( ) const -> std::string_view
inlinenodiscardoverridevirtual

Reimplemented from IRenderPass.

◆ prepare()

auto renderer::VoxelPass::prepare ( uint32_t frame_index) -> bool
nodiscard
Returns
false when nothing draws so the caller skips both voxel scopes
Here is the caller graph for this function:

◆ record()

void renderer::VoxelPass::record ( vk::CommandBuffer cmd,
uint32_t frame_index,
uint32_t image_index )
overridevirtual

Inside the voxel G-buffer scope after prepare() for everything the previous pyramid did not hide.

Implements IRenderPass.

Here is the caller graph for this function:

◆ stage()

auto renderer::VoxelPass::stage ( ) const -> RenderStage
inlinenodiscardoverridevirtual

Reimplemented from IRenderPass.


The documentation for this class was generated from the following files:
  • engine/src/toast/renderer/passes/voxel_pass.hpp
  • engine/src/toast/renderer/passes/voxel_pass.cpp