candlewick
0.6.0
A tiny cross-platform renderer based on SDL3
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
"
5
#include "
../core/LightUniforms.h
"
6
7
#include <SDL3/SDL_gpu.h>
8
#include <span>
9
10
namespace
candlewick
{
11
namespace
effects
{
12
14
struct
ScreenSpaceShadowPass
{
15
struct
Config
{
16
float
maxDist
= 1.0f;
17
int
numSteps
= 16;
18
}
config
;
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
{
28
return
depthTexture
&&
depthSampler
&&
targetTexture
&&
pipeline
;
29
}
30
31
ScreenSpaceShadowPass
(
NoInitT
) {}
32
ScreenSpaceShadowPass
(
const
RenderContext
&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
Core.h
LightUniforms.h
Tags.h
candlewick::CommandBuffer
Definition
CommandBuffer.h:17
candlewick::effects
Definition
ScreenSpaceShadows.h:11
candlewick
Definition
Camera.h:8
candlewick::Camera
The main way of using a camera to render things.
Definition
Camera.h:19
candlewick::DirectionalLight
Definition
LightUniforms.h:7
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::effects::ScreenSpaceShadowPass::Config
Definition
ScreenSpaceShadows.h:15
candlewick::effects::ScreenSpaceShadowPass::Config::maxDist
float maxDist
Definition
ScreenSpaceShadows.h:16
candlewick::effects::ScreenSpaceShadowPass::Config::numSteps
int numSteps
Definition
ScreenSpaceShadows.h:17
candlewick::effects::ScreenSpaceShadowPass::render
void render(CommandBuffer &cmdBuf, const Camera &camera, const DirectionalLight &light, std::span< const OpaqueCastable > castables)
candlewick::effects::ScreenSpaceShadowPass::config
struct candlewick::effects::ScreenSpaceShadowPass::Config config
candlewick::effects::ScreenSpaceShadowPass::depthSampler
SDL_GPUSampler * depthSampler
Sampler for the depth texture (e.g. from the prepass)
Definition
ScreenSpaceShadows.h:21
candlewick::effects::ScreenSpaceShadowPass::ScreenSpaceShadowPass
ScreenSpaceShadowPass(NoInitT)
Definition
ScreenSpaceShadows.h:31
candlewick::effects::ScreenSpaceShadowPass::valid
bool valid() const
Definition
ScreenSpaceShadows.h:27
candlewick::effects::ScreenSpaceShadowPass::depthTexture
SDL_GPUTexture * depthTexture
Definition
ScreenSpaceShadows.h:19
candlewick::effects::ScreenSpaceShadowPass::ScreenSpaceShadowPass
ScreenSpaceShadowPass(const RenderContext &renderer, const Config &config)
candlewick::effects::ScreenSpaceShadowPass::pipeline
SDL_GPUGraphicsPipeline * pipeline
Render pipeline.
Definition
ScreenSpaceShadows.h:25
candlewick::effects::ScreenSpaceShadowPass::release
void release(SDL_GPUDevice *device) noexcept
candlewick::effects::ScreenSpaceShadowPass::targetTexture
SDL_GPUTexture * targetTexture
Target texture to render the shadow to.
Definition
ScreenSpaceShadows.h:23
src
candlewick
posteffects
ScreenSpaceShadows.h
Generated by
1.13.2