载入中...
搜索中...
未找到
PbrSurface.h
浏览该文件的文档.
1#pragma once
2
3#include <array>
4#include <cstddef>
5#include <cstdint>
6#include "common/Export.h"
7#include "common/Result.h"
8namespace eve::graphics {
9class Texture;
11enum class PbrNormalMode : uint32_t {
12 TangentXYZ = 0,
13 VegetationRG = 1,
14 VegetationRAG = 2,
15 VegetationAG = 3
16};
18enum class PbrVegetationBackfaceNormalMode : uint32_t { Flip = 0, Mirror = 1, Same = 2 };
20enum class PbrCullMode : uint32_t { Inherit = 0, None = 1, Back = 2, Front = 3 };
40 Texture* texture = nullptr;
41 uint32_t texcoord = 0;
42 bool srgbDecode = true;
43 std::array<float, 2> offset{0, 0}, scale{1, 1};
44 float rotation = 0;
45 uint32_t wrapS = 10497, wrapT = 10497, minFilter = 9987, magFilter = 9729;
47 bool operator==(const PbrTextureBinding&) const = default;
48};
62 std::array<float, 3> color{1, 1, 1};
63 float intensity = 0, strength = 1, normalDistortion = .5f, scattering = 2;
64 float direct = .9f, ambient = .1f, shadow = .5f, maskAmount = 0;
65 float globalIntensity = 1, overlay = 1;
69 float maskMinimum = 0, maskMaximum = 0;
71 bool operator==(const PbrTranslucency&) const = default;
72};
110 std::array<PbrTextureBinding, 3> textures{};
111 std::array<float, 4> color{1, 1, 1, 1}, colorTwo{1, 1, 1, 1};
112 std::array<float, 2> uvScale{1, 1}, uvOffset{0, 0};
116 float meshMinimum = 0, meshMaximum = 1;
117 uint32_t uvMode = 0, colorMode = 0, blendMode = 0, alphaMode = 1;
118 uint32_t maskMode = 0, meshMode = 0;
119 bool inverseUvScale = false;
121 bool operator==(const PbrVegetationDetail&) const = default;
122};
131 Texture* texture = nullptr;
132 std::array<float, 9> usage{};
133 std::array<float, 4> fallback{1, 0, 0, 1};
134 std::array<float, 4> coords{1, 1, 0, 0};
135 uint32_t layer = 0;
136 bool usePivotPosition = false;
138 bool operator==(const PbrVegetationExtras&) const = default;
139};
145 Texture* texture = nullptr;
146 std::array<float, 9> usage{};
147 std::array<float, 4> fallback{1, 1, 1, 0}, coords{1, 1, 0, 0};
148 uint32_t layer = 0;
149 bool usePivotPosition = false;
151 bool operator==(const PbrVegetationColors&) const = default;
152};
166 Texture* texture = nullptr;
167 std::array<float, 9> usage{};
168 std::array<float, 4> fallback{0, 0, 0, 1}, coords{1, 1, 0, 0};
170 uint32_t layer = 0;
173 bool operator==(const PbrVegetationVertex&) const = default;
174};
176enum class PbrVegetationMotionMode : uint32_t { Disabled, Object };
186 Texture* texture = nullptr;
187 Texture* noise = nullptr;
188 std::array<float, 9> usage{};
189 std::array<float, 4> fallback{1, 0, .5f, 0}, coords{1, 1, 0, 0};
190 std::array<float, 2> globalDirection{1, 0};
191 std::array<float, 3> worldOrigin{0, 0, 0};
192 double time = 0;
193 float dynamicMode = 0, rigidity = .5f, facing = .5f;
195 float branch = .2f, rolling = .2f, branchSpeed = 6, branchScale = 3, branchVariation = 0;
196 float flutter = .2f, flutterSpeed = 20, flutterScale = 10, flutterVariation = 0;
200 uint32_t layer = 0;
203 bool operator==(const PbrVegetationMotion&) const = default;
204};
210 Texture* noise = nullptr;
211 float global = 0, variation = 0;
212 float glancing = 0, camera = 1, constant = 0;
214 bool detailFade = false;
215 bool enabled = false;
217 bool operator==(const PbrVegetationAlpha&) const = default;
218};
221 float minimum = 0, maximum = 1, phase = 1, global = 1;
222 bool enabled = false;
224 bool operator==(const PbrVegetationEmission&) const = default;
225};
228 std::array<float, 3> colorOne{1, 1, 1}, colorTwo{1, 1, 1};
229 float minimum = 0, maximum = 1;
230 bool enabled = false;
232 bool operator==(const PbrVegetationGradient&) const = default;
233};
300} // namespace eve::graphics
#define EVENGINE_API_BACKENDS
Definition Export.h:108
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:176
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
PbrNormalMode
Per-fragment normal decoding, evaluated after texture filtering.
Definition PbrSurface.h:11
PbrCullMode
Raster face culling requested by a PBR material.
Definition PbrSurface.h:20
PbrVegetationBackfaceNormalMode
TVE tangent-space normal treatment for back-facing fragments.
Definition PbrSurface.h:18
PbrTextureSlot
Canonical glTF texture roles, with fixed semantic channels (not a UV set limit).
Definition PbrSurface.h:22
Result< void > validatePbrSurface(const PbrSurface &s)
Validate finite material factors and sampler enums without changing the input.
PbrVegetationMotionMode
Select source-equivalent GPU motion evaluation for rest vegetation geometry.
Definition PbrSurface.h:176
PbrVegetationDeformationSource
Select the single owner of vegetation vertex deformation for a draw. RestMesh leaves authored positio...
Definition PbrSurface.h:158
Owning material parameter snapshot; texture pointers remain borrowed. Base color/metallic/roughness c...
Definition PbrSurface.h:240
bool alphaToCoverage
Enable alpha-to-coverage for masked rendering when the active target is multisampled.
Definition PbrSurface.h:267
std::array< float, 3 > motionHighlightColor
Owning linear nonnegative motion-highlight RGB; zero disables the effect. Multiplies final albedo by ...
Definition PbrSurface.h:291
bool colorMaskEnabled
Optional per-fragment RGB blend using projected ORM alpha as the color mask. Primary RGB remains Mate...
Definition PbrSurface.h:255
float albedoTextureStrength
Interpolate texture RGB from white; texture alpha is unaffected. Range [0,1].
Definition PbrSurface.h:259
PbrVegetationMotion vegetationMotion
Definition PbrSurface.h:281
PbrVegetationExtras vegetationExtras
Definition PbrSurface.h:278
bool operator==(const PbrSurface &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
std::array< PbrTextureBinding, std::size_t(PbrTextureSlot::Count)> textures
Definition PbrSurface.h:241
PbrVegetationVertex vegetationVertex
Definition PbrSurface.h:280
PbrVegetationColors vegetationColors
Definition PbrSurface.h:279
std::array< float, 3 > colorMaskSecondary
Definition PbrSurface.h:256
PbrVegetationDetail vegetationDetail
Definition PbrSurface.h:277
PbrVegetationGradient vegetationGradient
Definition PbrSurface.h:284
std::array< float, 3 > emissive
Definition PbrSurface.h:242
PbrTranslucency translucency
Per-light vegetation backlighting. Native ambient RGB supplies the GI term. Positive maskAmount with ...
Definition PbrSurface.h:275
PbrVegetationAlpha vegetationAlpha
Definition PbrSurface.h:282
PbrNormalMode normalMode
Normal reconstruction; vegetation modes require a linear Normal texture and normalScale in [-8,...
Definition PbrSurface.h:264
PbrVegetationColorStages vegetationColor
Definition PbrSurface.h:276
std::array< float, 3 > specularColor
Definition PbrSurface.h:242
PbrVegetationEmission vegetationEmission
Definition PbrSurface.h:283
One borrowed texture plus independently owned UV/sampler parameters. Texture is graphics-factory-owne...
Definition PbrSurface.h:39
std::array< float, 2 > offset
Definition PbrSurface.h:43
std::array< float, 2 > scale
Definition PbrSurface.h:43
bool operator==(const PbrTextureBinding &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
Owning vegetation translucency controls, evaluated per light after normal mapping....
Definition PbrSurface.h:61
bool operator==(const PbrTranslucency &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
std::array< float, 3 > color
Definition PbrSurface.h:62
float maskMinimum
Independent ORM-alpha endpoints in [0,1]. Reversed ranges are valid; maximum-minimum+0....
Definition PbrSurface.h:69
TVE global-alpha controls applied after optional detail alpha blending. When enabled,...
Definition PbrSurface.h:209
bool operator==(const PbrVegetationAlpha &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
Owning per-fragment TVE surface-stage inputs in linear space. Scalar controls are [0,...
Definition PbrSurface.h:86
std::array< float, 4 > fieldColor
Definition PbrSurface.h:87
std::array< float, 3 > vertexOcclusionColor
Definition PbrSurface.h:88
PbrVegetationBackfaceNormalMode backfaceNormalMode
Definition PbrSurface.h:98
bool operator==(const PbrVegetationColorStages &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
std::array< float, 3 > overlayColor
Definition PbrSurface.h:88
Borrowed TVE Colors RGBA16F array and owning layer sampling controls. RGB is linear tint and alpha is...
Definition PbrSurface.h:144
bool operator==(const PbrVegetationColors &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
std::array< float, 4 > fallback
Definition PbrSurface.h:147
std::array< float, 4 > coords
Definition PbrSurface.h:147
std::array< float, 9 > usage
Definition PbrSurface.h:146
TVE secondary material layer evaluated after primary texture sampling. Three borrowed bindings contai...
Definition PbrSurface.h:109
bool operator==(const PbrVegetationDetail &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
std::array< PbrTextureBinding, 3 > textures
Definition PbrSurface.h:110
std::array< float, 2 > uvScale
Definition PbrSurface.h:112
std::array< float, 4 > colorTwo
Definition PbrSurface.h:111
std::array< float, 4 > color
Definition PbrSurface.h:111
std::array< float, 2 > uvOffset
Definition PbrSurface.h:112
TVE emissive remap and global Extras modulation for the borrowed emissive texture binding.
Definition PbrSurface.h:220
bool operator==(const PbrVegetationEmission &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
Borrowed TVE Extras RGBA16F array and owning sampling controls. Channels are emissive,...
Definition PbrSurface.h:130
std::array< float, 4 > coords
Definition PbrSurface.h:134
bool operator==(const PbrVegetationExtras &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
std::array< float, 9 > usage
Definition PbrSurface.h:132
std::array< float, 4 > fallback
Definition PbrSurface.h:133
TVE mesh-height gradient tint, masked by the blended main/detail blue channel.
Definition PbrSurface.h:227
bool operator==(const PbrVegetationGradient &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
std::array< float, 3 > colorTwo
Definition PbrSurface.h:228
std::array< float, 3 > colorOne
Definition PbrSurface.h:228
Borrowed TVE Motion atlas/noise and owning explicit object-motion controls. Object mode requires an u...
Definition PbrSurface.h:185
bool operator==(const PbrVegetationMotion &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
std::array< float, 4 > coords
Definition PbrSurface.h:189
std::array< float, 9 > usage
Definition PbrSurface.h:188
std::array< float, 3 > worldOrigin
Definition PbrSurface.h:191
std::array< float, 4 > fallback
Definition PbrSurface.h:189
std::array< float, 2 > globalDirection
Definition PbrSurface.h:190
PbrVegetationMotionMode mode
Definition PbrSurface.h:201
Borrowed TVE Vertex RGBA16F array and object-level size controls. TVE Plant Standard 12....
Definition PbrSurface.h:165
std::array< float, 9 > usage
Definition PbrSurface.h:167
std::array< float, 4 > coords
Definition PbrSurface.h:168
bool operator==(const PbrVegetationVertex &) const =default
Compare owned parameters and borrowed texture identities without dereferencing resources.
std::array< float, 4 > fallback
Definition PbrSurface.h:168
PbrVegetationDeformationSource source
Definition PbrSurface.h:171