candlewick 0.1.0
A renderer
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
7namespace candlewick {
8namespace 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;
16 struct SsaoNoise {
18 SDL_GPUSampler *sampler = nullptr;
19 // The texture will be N x N where N is this value.
22 SDL_GPUGraphicsPipeline *blurPipeline = nullptr;
23 // first blur pass target
25
27 SsaoPass(const Renderer &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
Definition CommandBuffer.h:17
Definition Texture.h:9
Definition SSAO.h:8
Definition Camera.h:8
constexpr NoInitT NoInit
Definition Tags.h:9
The main way of using a camera to render things.
Definition Camera.h:19
Tag type for non-initializing constructors (for e.g. RAII classes)
Definition Tags.h:6
The Renderer class provides a rendering context for a graphical application.
Definition Renderer.h:20
Texture tex
Definition SSAO.h:17
Uint32 pixel_window_size
Definition SSAO.h:20
SDL_GPUSampler * sampler
Definition SSAO.h:18
SsaoPass(const Renderer &renderer, SDL_GPUTexture *normalMap)
SDL_GPUDevice * _device
Definition SSAO.h:10
SDL_GPUTexture * inNormalMap
Definition SSAO.h:12
SsaoPass & operator=(SsaoPass &&other) noexcept
SDL_GPUGraphicsPipeline * pipeline
Definition SSAO.h:14
SDL_GPUSampler * texSampler
Definition SSAO.h:13
SDL_GPUTexture * inDepthMap
Definition SSAO.h:11
Texture blurPass1Tex
Definition SSAO.h:24
SsaoPass(NoInitT)
Definition SSAO.h:26
SDL_GPUGraphicsPipeline * blurPipeline
Definition SSAO.h:22
struct candlewick::ssao::SsaoPass::SsaoNoise ssaoNoise
void render(CommandBuffer &cmdBuf, const Camera &camera)
Texture ssaoMap
Definition SSAO.h:15
SsaoPass(SsaoPass &&other) noexcept