载入中...
搜索中...
未找到
Shadow.h
浏览该文件的文档.
1#pragma once
2
3#include <glm/glm.hpp>
4
5namespace eve::graphics {
6
8 static constexpr int kCascades = 3;
9 static constexpr int kMapSize = 2048;
10 static constexpr float kSplitLambda = 0.7f;
13 static constexpr float kMaxDistance = 64.f;
14};
15
17struct ShadowUBO {
19 glm::vec4 splits{0.f}; // xyz = view-space +Z split ends (camera-forward distance); w = strength
20 glm::vec4 bias{0.002f, 0.f, 1.f, 0.f}; // x=c0 fallback, y=enabled, z=receive, w unused
21 glm::vec4 cascadeBias{0.f}; // xyz = per-cascade NDC compare bias
22 glm::vec4 cascadeTexel{0.f}; // xyz = world units per shadow texel
23};
24
27 bool active = false;
28};
29
39ShadowUpload buildDirectionalCSM(const glm::vec3 &lightDirTowardSurface, const glm::vec3 &eye,
40 const glm::vec3 &target, const glm::vec3 &up, float fovYRad,
41 float aspect, float nearZ, float farZ, float bias, float strength);
42
43} // namespace eve::graphics
glm::vec3 eye
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition AnimTrail.h:6
ShadowUpload buildDirectionalCSM(const glm::vec3 &lightDirTowardSurface, const glm::vec3 &eye, const glm::vec3 &target, const glm::vec3 &up, float fovYRad, float aspect, float nearZ, float farZ, float bias, float strength)
Build 3 cascade light view-proj matrices for a directional light.
Definition Shadow.cpp:83
static constexpr float kSplitLambda
Definition Shadow.h:10
static constexpr int kMapSize
Definition Shadow.h:9
static constexpr float kMaxDistance
Definition Shadow.h:13
static constexpr int kCascades
Definition Shadow.h:8
Per-frame / per-draw CSM constants (std140). Binding separate from Mesh3D Frame UBO.
Definition Shadow.h:17
glm::vec4 cascadeTexel
Definition Shadow.h:22
glm::vec4 cascadeBias
Definition Shadow.h:21
glm::mat4 lightVP[ShadowConfig::kCascades]
Definition Shadow.h:18