载入中...
搜索中...
未找到
PathTracing.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdint>
4#include <glm/mat4x4.hpp>
5#include <glm/vec2.hpp>
6#include <glm/vec3.hpp>
7#include <span>
8
9namespace eve::graphics {
10class Mesh;
11class Texture;
12
14enum class PathAlphaMode : uint32_t { Opaque, Masked, Blend };
15
21 glm::vec3 baseColor{1.f};
22 glm::vec3 emission{0.f};
23 float roughness = 1.f;
24 float metallic = 0.f;
25 uint32_t baseColorTexture = UINT32_MAX;
26 float opacity = 1.f;
27 float alphaCutoff = 0.5f;
30 uint32_t metallicRoughnessTexture = UINT32_MAX;
32 uint32_t emissionTexture = UINT32_MAX;
34 uint32_t normalTexture = UINT32_MAX;
36 float normalScale = 1.f;
37};
38
40enum class PathTextureFilter : uint8_t { Source, Nearest, Linear };
42enum class PathTextureAddress : uint8_t { Source, Repeat, Clamp, Mirror };
43
56 uint32_t width = 0, height = 0;
57 std::span<const glm::vec3> pixels;
58 std::span<const float> alpha;
60 bool srgbDecode = true;
62 glm::vec2 offset{0.f}, scale{1.f};
63 float rotation = 0.f;
67};
68
76 std::span<const glm::vec3> positions;
77 std::span<const glm::vec3> normals;
78 std::span<const uint32_t> indices;
79 uint32_t material = 0;
80 std::span<const glm::vec2> texcoords;
81 Mesh* sourceMesh = nullptr;
84 std::span<const glm::vec3> tangents, bitangents;
85};
86
89 uint32_t geometry = 0;
90 glm::mat4 transform{1.f};
91};
92
94enum class PathLightKind : uint8_t { Point, Directional, Spot };
95
104struct PathLight {
106 glm::vec3 position{0.f};
107 glm::vec3 directionToLight{0.f, 0.f, -1.f};
108 glm::vec3 strength{1.f};
110 glm::vec3 beamDirection{0.f, 0.f, 1.f};
112 float cosOuter = 0.8f, cosInner = 0.95f;
113};
114
120 std::span<const PathGeometry> geometry;
121 std::span<const PathInstance> instances;
122 std::span<const PathMaterial> materials;
123 std::span<const PathLight> lights;
124 std::span<const PathColorTexture> colorTextures;
125};
126
131 uint64_t generation = 0;
132};
133
136 uint64_t generation = 0;
137};
138
140enum class PathDenoise : uint8_t { None, Spatial, Temporal };
141
147 glm::mat4 invViewProj{1.f};
148 glm::vec3 eye{0.f};
149 glm::vec3 environment{0.f};
150 uint32_t firstSample = 0;
151 uint32_t samples = 1;
152 uint32_t maxBounces = 4;
153 uint32_t seed = 0;
154 uint32_t historySamples = 0;
161};
162
163} // namespace eve::graphics
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:26
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:15
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
PathTextureFilter
Base-level filter override; Source uses the source sampler (linear for pixel spans).
Definition PathTracing.h:40
PathDenoise
Output reconstruction; spatial filtering does not modify raw accumulation.
PathAlphaMode
Surface coverage: opaque, cutoff mask, or stochastic alpha coverage (not refraction).
Definition PathTracing.h:14
PathTextureAddress
Address override; Source uses the source sampler (repeat for pixel spans).
Definition PathTracing.h:42
PathLightKind
Analytic light distribution; area emitters are derived from emissive geometry.
Definition PathTracing.h:94
Base-level color or material-data texture from linear pixels or an owned engine RGBA8 texture....
Definition PathTracing.h:55
std::span< const glm::vec3 > pixels
Definition PathTracing.h:57
glm::vec2 offset
UV transform applied as offset + rotation * (scale * UV), before addressing.
Definition PathTracing.h:62
PathTextureAddress addressV
Definition PathTracing.h:66
PathTextureFilter filter
Independent material binding overrides; source texture state is never mutated.
Definition PathTracing.h:65
PathTextureAddress addressU
Definition PathTracing.h:66
std::span< const float > alpha
Definition PathTracing.h:58
Provider-owned frame output identity; invalidated by resize, scene replacement or device detach.
Indexed geometry; spans are borrowed only during scene preparation. @ownership Caller owns all spans ...
Definition PathTracing.h:75
std::span< const glm::vec3 > normals
Definition PathTracing.h:77
std::span< const glm::vec2 > texcoords
Definition PathTracing.h:80
std::span< const glm::vec3 > tangents
Optional authored object-space XYZ frames, one pair per vertex; copied during preparation....
Definition PathTracing.h:84
std::span< const uint32_t > indices
Definition PathTracing.h:78
std::span< const glm::vec3 > positions
Definition PathTracing.h:76
std::span< const glm::vec3 > bitangents
Definition PathTracing.h:84
Instance of shared geometry with an invertible affine object-to-world transform.
Definition PathTracing.h:88
World-space analytic light copied during scene preparation.
float cosOuter
Spot half-angle cosines, -1 <= outer <= inner <= 1.
glm::vec3 beamDirection
Finite nonzero emission direction for spot lights.
Linear-light surface parameters for path tracing.
Definition PathTracing.h:20
uint32_t metallicRoughnessTexture
Linear data map: green multiplies roughness, blue multiplies metallic.
Definition PathTracing.h:30
uint32_t normalTexture
Linear tangent-space XYZ normal map, decoded from [0,1] to [-1,1].
Definition PathTracing.h:34
uint32_t emissionTexture
Linear RGB multiplier of emission; native sRGB inputs are decoded during sampling.
Definition PathTracing.h:32
float normalScale
Finite signed multiplier of tangent-space normal X/Y before normalization.
Definition PathTracing.h:36
Borrowed scene snapshot; preparation copies all inputs into provider-owned resources....
std::span< const PathInstance > instances
std::span< const PathGeometry > geometry
std::span< const PathLight > lights
std::span< const PathMaterial > materials
std::span< const PathColorTexture > colorTextures
Opaque prepared-scene identity; invalid after replacement or device detachment. @ownership Does not o...
Deterministic path sample batch. Zero history starts a new accumulation.
bool resetTemporalHistory
Discard temporal reconstruction history for this batch (for example an explicit camera cut)....