VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
shadowMap.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
// Copyright 2025-2026 Arnis Lektauers
3
//
4
// Created by Arnis Lektauets on 02.10.2025.
5
//
6
#pragma once
7
#include <memory>
8
9
#include "
platform/graphics/renderTarget.h
"
10
#include "
platform/graphics/texture.h
"
11
12
namespace
visutwin::canvas
13
{
14
class
GraphicsDevice
;
15
class
Light
;
16
17
class
ShadowMap
18
{
19
public
:
20
const
std::vector<std::shared_ptr<RenderTarget>>&
renderTargets
()
const
{
return
_renderTargets; }
21
22
// Returns the depth texture used for shadow sampling in the forward pass.
23
Texture
*
shadowTexture
()
const
{
return
_shadowTexture.get(); }
24
25
// Creates a shadow map for the given light, allocating depth texture and render target.
26
static
std::unique_ptr<ShadowMap>
create
(
GraphicsDevice
* device,
Light
* light);
27
28
private
:
29
// An array of render targets:
30
// 1 for directional and spotlight
31
// 6 for omni light
32
std::vector<std::shared_ptr<RenderTarget>> _renderTargets;
33
34
// The depth texture backing the shadow map, owned by this ShadowMap.
35
std::shared_ptr<Texture> _shadowTexture;
36
};
37
}
visutwin::canvas::GraphicsDevice
Abstract GPU interface for resource creation, state management, and draw submission.
Definition
graphicsDevice.h:239
visutwin::canvas::Light
Directional, point, spot, or area light with shadow mapping and cookie projection.
Definition
light.h:54
visutwin::canvas::ShadowMap
Definition
shadowMap.h:18
visutwin::canvas::ShadowMap::shadowTexture
Texture * shadowTexture() const
Definition
shadowMap.h:23
visutwin::canvas::ShadowMap::create
static std::unique_ptr< ShadowMap > create(GraphicsDevice *device, Light *light)
Definition
shadowMap.cpp:15
visutwin::canvas::ShadowMap::renderTargets
const std::vector< std::shared_ptr< RenderTarget > > & renderTargets() const
Definition
shadowMap.h:20
visutwin::canvas::Texture
GPU texture resource supporting 2D, cubemap, volume, and array formats with mipmap management.
Definition
texture.h:57
visutwin::canvas
Definition
eventHandler.cpp:9
renderTarget.h
texture.h
scene
renderer
shadowMap.h
Generated by
1.16.1