candlewick
0.11.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/GraphicsPipeline.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
GraphicsPipeline
pipeline
{
NoInit
};
15
Texture
ssaoMap
{
NoInit
};
16
Uint32
kernelSize
= 16u;
17
struct
SsaoNoise
{
18
Texture
tex
{
NoInit
};
19
SDL_GPUSampler *
sampler
=
nullptr
;
20
// The texture will be N x N where N is this value.
21
Uint32
pixel_window_size
;
22
}
ssaoNoise
;
23
GraphicsPipeline
blurPipeline
{
NoInit
};
24
// first blur pass target
25
Texture
blurPass1Tex
{
NoInit
};
26
27
SsaoPass
(
NoInitT
) {}
28
SsaoPass
(
const
RenderContext
&renderer, SDL_GPUTexture *
inNormalMap
,
29
SDL_GPUTexture *inDepthTex, Uint32
kernelSize
= 16u);
30
31
SsaoPass
(
SsaoPass
&&other)
noexcept
;
32
SsaoPass
&
operator=
(
SsaoPass
&&other)
noexcept
;
33
34
void
render
(
CommandBuffer
&cmdBuf,
const
Camera
&camera);
35
36
// cleanup function
37
void
release
() noexcept;
38
39
~
SsaoPass
() noexcept { this->
release
(); }
40
};
41
42
}
// namespace ssao
43
}
// namespace candlewick
GraphicsPipeline.h
Texture.h
candlewick::CommandBuffer
Definition
CommandBuffer.h:16
candlewick::GraphicsPipeline
Class representing a graphics pipeline.
Definition
GraphicsPipeline.h:15
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:36
candlewick::ssao::SsaoPass::SsaoNoise
Definition
SSAO.h:17
candlewick::ssao::SsaoPass::SsaoNoise::tex
Texture tex
Definition
SSAO.h:18
candlewick::ssao::SsaoPass::SsaoNoise::pixel_window_size
Uint32 pixel_window_size
Definition
SSAO.h:21
candlewick::ssao::SsaoPass::SsaoNoise::sampler
SDL_GPUSampler * sampler
Definition
SSAO.h:19
candlewick::ssao::SsaoPass::SsaoPass
SsaoPass(const RenderContext &renderer, SDL_GPUTexture *inNormalMap, SDL_GPUTexture *inDepthTex, Uint32 kernelSize=16u)
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::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:25
candlewick::ssao::SsaoPass::SsaoPass
SsaoPass(NoInitT)
Definition
SSAO.h:27
candlewick::ssao::SsaoPass::kernelSize
Uint32 kernelSize
Definition
SSAO.h:16
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::blurPipeline
GraphicsPipeline blurPipeline
Definition
SSAO.h:23
candlewick::ssao::SsaoPass::pipeline
GraphicsPipeline pipeline
Definition
SSAO.h:14
candlewick::ssao::SsaoPass::SsaoPass
SsaoPass(SsaoPass &&other) noexcept
src
candlewick
posteffects
SSAO.h
Generated by
1.13.2