载入中...
搜索中...
未找到
ClusteredLight.h
浏览该文件的文档.
1#pragma once
2
3#include "graphics/Light.h"
4
5#include <cstdint>
6#include <vector>
7#include <glm/glm.hpp>
8
9namespace eve::graphics {
10
13 static constexpr int kTilesX = 16;
14 static constexpr int kTilesY = 9;
15 static constexpr int kSlices = 24;
16 static constexpr int kClusterCount = kTilesX * kTilesY * kSlices;
17 static constexpr int kMaxLights = 256;
18 static constexpr int kMaxLightsPerCluster = 32;
19};
20
22
24 uint32_t offset = 0;
25 uint32_t count = 0;
26};
27
33 glm::vec4 ambient{0.12f, 0.12f, 0.14f, 0.f};
35 float(ClusteredLightConfig::kSlices), 0.f}; // w = point light count
36 glm::vec4 clipInfo{0.1f, 100.f, 1.f, 1.f}; // near, far, screenW, screenH
37 glm::mat4 view{1.f};
38 glm::vec4 primaryDir{0.4f, 1.f, 0.3f, 0.f}; // toward surface; w=1 if valid
39 glm::vec4 primaryColor{1.f, 1.f, 1.f, 1.f};
40 std::vector<ClusteredLightGpu> lights; // point lights only (world space)
41 std::vector<ClusterTableEntry> clusterTable; // size = kClusterCount
42 std::vector<uint32_t> lightIndices;
43 bool active = false;
44};
45
51ClusteredLightingUpload buildClusteredLighting(const std::vector<ClusteredLightGpu> &points,
52 const std::vector<ClusteredLightGpu> &dirs,
53 const glm::mat4 &view, float nearZ, float farZ,
54 int screenW, int screenH, float fovYRad,
55 const glm::vec4 &ambient);
56
57} // namespace eve::graphics
glm::mat4 view
std::vector< V3 > points
Definition TreeMesh.cpp:126
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition AnimTrail.h:6
ClusteredLightingUpload buildClusteredLighting(const std::vector< ClusteredLightGpu > &points, const std::vector< ClusteredLightGpu > &dirs, const glm::mat4 &view, float nearZ, float farZ, int screenW, int screenH, float fovYRad, const glm::vec4 &ambient)
Build clustered tables for point lights in view space.
Clustered forward grid (CPU assign, GPU consume).
static constexpr int kMaxLightsPerCluster
CPU-built clustered lighting upload for one frame/camera. Point lights are clustered; directional lig...
std::vector< ClusteredLightGpu > lights
std::vector< ClusterTableEntry > clusterTable
GPU light packing for mesh3d / PBR (std140-friendly).
Definition Light.h:85