载入中...
搜索中...
未找到
PbrGpuUniform.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdint>
4
5#include <glm/mat4x4.hpp>
6#include <glm/vec4.hpp>
7
8#include "graphics/Light.h"
10
11namespace eve::graphics::detail {
12
14struct alignas(16) PbrUvInfoGpu {
15 float rotation = 0.f;
16 std::uint32_t offset = UINT32_MAX;
17 float present = 0.f;
18 float srgb = 0.f;
19};
20
22struct alignas(16) PbrUniformGpu {
23 glm::mat4 mvp{1.f}, model{1.f}, view{1.f};
24 glm::vec4 camera{}, tint{}, ambient{}, material{};
25 glm::vec4 emissive{}, specular{}, coat{}, misc{};
27 glm::vec4 uvTransform[11]{};
30 glm::uvec4 tangentInfo{};
38 glm::uvec4 vegetationInfo{};
41 glm::uvec4 detailInfo{}, detailInfo2{};
43 glm::uvec4 extrasInfo{};
47 glm::uvec4 colorsInfo{};
49 glm::vec4 vertexSize{};
50 glm::uvec4 vertexInfo{};
54 glm::uvec4 motionInfo{};
55};
56
57static_assert(sizeof(PbrUvInfoGpu) == 16);
58static_assert(sizeof(Light3DGpu) == 48);
59static_assert(sizeof(PbrUniformGpu) == 2080); // +16 bytes/light for Light3DGpu.spot
60
64 glm::mat4 mvp{1.f};
65 glm::mat4 model{1.f};
66 glm::mat4 view{1.f};
67 glm::vec3 camera{};
68 glm::vec4 tint{1.f};
69 glm::vec4 ambient{};
71 float metallic = 0.f, roughness = 1.f, surfaceCode = 0.f, alphaCutoff = .5f;
73 std::uint32_t skinCount = 0;
74};
75
78
79} // namespace eve::graphics::detail
int inputs
Definition GridGraph.cpp:23
PbrUniformGpu buildPbrUniformGpu(const PbrUniformBuildInputs &inputs)
Build all material and scene fields; mesh stream offsets remain disabled for the backend to fill.
GPU light packing for mesh3d / PBR (std140-friendly).
Definition Light.h:161
Lighting3DPack public API.
Definition Light.h:172
Owning material parameter snapshot; texture pointers remain borrowed. Base color/metallic/roughness c...
Definition PbrSurface.h:218
Backend-neutral state needed to build one immutable PBR uniform snapshot.
Canonical std140 payload consumed by both generated PBR shader stages.
std140 texture-coordinate metadata shared by Vulkan and WebGPU PBR shaders.