candlewick 0.1.0
A renderer
Loading...
Searching...
No Matches
ScreenSpaceShadows.h
Go to the documentation of this file.
1#pragma once
2
3#include "../core/Core.h"
4#include "../core/Tags.h"
6
7#include <SDL3/SDL_gpu.h>
8#include <span>
9
10namespace candlewick {
11namespace effects {
12
15 struct Config {
16 float maxDist = 1.0f;
17 int numSteps = 16;
19 SDL_GPUTexture *depthTexture = nullptr;
21 SDL_GPUSampler *depthSampler = nullptr;
23 SDL_GPUTexture *targetTexture = nullptr;
25 SDL_GPUGraphicsPipeline *pipeline = nullptr;
26
27 bool valid() const {
29 }
30
32 ScreenSpaceShadowPass(const Renderer &renderer, const Config &config);
33
34 void release(SDL_GPUDevice *device) noexcept;
35
36 void render(CommandBuffer &cmdBuf, const Camera &camera,
37 const DirectionalLight &light,
38 std::span<const OpaqueCastable> castables);
39 };
40
41} // namespace effects
42} // namespace candlewick
Definition CommandBuffer.h:17
Definition ScreenSpaceShadows.h:11
Definition Camera.h:8
The main way of using a camera to render things.
Definition Camera.h:19
Definition LightUniforms.h:7
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
Definition ScreenSpaceShadows.h:15
float maxDist
Definition ScreenSpaceShadows.h:16
int numSteps
Definition ScreenSpaceShadows.h:17
void render(CommandBuffer &cmdBuf, const Camera &camera, const DirectionalLight &light, std::span< const OpaqueCastable > castables)
struct candlewick::effects::ScreenSpaceShadowPass::Config config
SDL_GPUSampler * depthSampler
Sampler for the depth texture (e.g. from the prepass)
Definition ScreenSpaceShadows.h:21
ScreenSpaceShadowPass(NoInitT)
Definition ScreenSpaceShadows.h:31
bool valid() const
Definition ScreenSpaceShadows.h:27
ScreenSpaceShadowPass(const Renderer &renderer, const Config &config)
SDL_GPUTexture * depthTexture
Definition ScreenSpaceShadows.h:19
SDL_GPUGraphicsPipeline * pipeline
Render pipeline.
Definition ScreenSpaceShadows.h:25
void release(SDL_GPUDevice *device) noexcept
SDL_GPUTexture * targetTexture
Target texture to render the shadow to.
Definition ScreenSpaceShadows.h:23