candlewick
0.6.0
A tiny cross-platform renderer based on SDL3
Loading...
Searching...
No Matches
SSAO.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
../core/Core.h
"
4
#include "
../core/Texture.h
"
5
#include <SDL3/SDL_gpu.h>
6
7
namespace
candlewick
{
8
namespace
ssao
{
9
struct
SsaoPass
{
10
SDL_GPUDevice *
_device
=
nullptr
;
11
SDL_GPUTexture *
inDepthMap
=
nullptr
;
12
SDL_GPUTexture *
inNormalMap
=
nullptr
;
13
SDL_GPUSampler *
texSampler
=
nullptr
;
14
SDL_GPUGraphicsPipeline *
pipeline
=
nullptr
;
15
Texture
ssaoMap
{
NoInit
};
16
struct
SsaoNoise
{
17
Texture
tex
{
NoInit
};
18
SDL_GPUSampler *
sampler
=
nullptr
;
19
// The texture will be N x N where N is this value.
20
Uint32
pixel_window_size
;
21
}
ssaoNoise
;
22
SDL_GPUGraphicsPipeline *
blurPipeline
=
nullptr
;
23
// first blur pass target
24
Texture
blurPass1Tex
{
NoInit
};
25
26
SsaoPass
(
NoInitT
) {}
27
SsaoPass
(
const
RenderContext
&renderer, SDL_GPUTexture *normalMap);
28
29
SsaoPass
(
SsaoPass
&&other)
noexcept
;
30
SsaoPass
&
operator=
(
SsaoPass
&&other)
noexcept
;
31
32
void
render
(
CommandBuffer
&cmdBuf,
const
Camera
&camera);
33
34
// cleanup function
35
void
release
() noexcept;
36
37
~
SsaoPass
() noexcept { this->
release
(); }
38
};
39
40
}
// namespace ssao
41
}
// namespace candlewick
Core.h
Texture.h
candlewick::CommandBuffer
Definition
CommandBuffer.h:17
candlewick::Texture
Definition
Texture.h:9
candlewick::ssao
Definition
SSAO.h:8
candlewick
Definition
Camera.h:8
candlewick::NoInit
constexpr NoInitT NoInit
Definition
Tags.h:9
candlewick::Camera
The main way of using a camera to render things.
Definition
Camera.h:19
candlewick::NoInitT
Tag type for non-initializing constructors (for e.g. RAII classes)
Definition
Tags.h:6
candlewick::RenderContext
The RenderContext class provides a rendering context for a graphical application.
Definition
RenderContext.h:20
candlewick::ssao::SsaoPass::SsaoNoise
Definition
SSAO.h:16
candlewick::ssao::SsaoPass::SsaoNoise::tex
Texture tex
Definition
SSAO.h:17
candlewick::ssao::SsaoPass::SsaoNoise::pixel_window_size
Uint32 pixel_window_size
Definition
SSAO.h:20
candlewick::ssao::SsaoPass::SsaoNoise::sampler
SDL_GPUSampler * sampler
Definition
SSAO.h:18
candlewick::ssao::SsaoPass::release
void release() noexcept
candlewick::ssao::SsaoPass::_device
SDL_GPUDevice * _device
Definition
SSAO.h:10
candlewick::ssao::SsaoPass::inNormalMap
SDL_GPUTexture * inNormalMap
Definition
SSAO.h:12
candlewick::ssao::SsaoPass::operator=
SsaoPass & operator=(SsaoPass &&other) noexcept
candlewick::ssao::SsaoPass::SsaoPass
SsaoPass(const RenderContext &renderer, SDL_GPUTexture *normalMap)
candlewick::ssao::SsaoPass::pipeline
SDL_GPUGraphicsPipeline * pipeline
Definition
SSAO.h:14
candlewick::ssao::SsaoPass::texSampler
SDL_GPUSampler * texSampler
Definition
SSAO.h:13
candlewick::ssao::SsaoPass::inDepthMap
SDL_GPUTexture * inDepthMap
Definition
SSAO.h:11
candlewick::ssao::SsaoPass::blurPass1Tex
Texture blurPass1Tex
Definition
SSAO.h:24
candlewick::ssao::SsaoPass::SsaoPass
SsaoPass(NoInitT)
Definition
SSAO.h:26
candlewick::ssao::SsaoPass::blurPipeline
SDL_GPUGraphicsPipeline * blurPipeline
Definition
SSAO.h:22
candlewick::ssao::SsaoPass::ssaoNoise
struct candlewick::ssao::SsaoPass::SsaoNoise ssaoNoise
candlewick::ssao::SsaoPass::render
void render(CommandBuffer &cmdBuf, const Camera &camera)
candlewick::ssao::SsaoPass::ssaoMap
Texture ssaoMap
Definition
SSAO.h:15
candlewick::ssao::SsaoPass::SsaoPass
SsaoPass(SsaoPass &&other) noexcept
src
candlewick
posteffects
SSAO.h
Generated by
1.13.2