载入中...
搜索中...
未找到
Material.cpp
浏览该文件的文档.
1#include "graphics/Material.h"
2
3#include <utility>
4
6#include "graphics/Graphics.h"
7#include "graphics/Light.h"
8#include "graphics/Mesh.h"
9#include "graphics/Shader.h"
10#include "graphics/Texture.h"
11
12#include <algorithm>
13#include <cmath>
14
15namespace eve::graphics {
16
17namespace {
18eve::Diagnostic invalidMaterial(std::string message) {
20}
21} // namespace
22
25 if (!created.ok()) return eve::Result<void>::failure(created.status());
26 virtualStreaming_ = std::move(created).value();
27 virtualStreamingEpoch_ = 0;
28 virtualStreamingInitialized_ = false;
29 virtualTextureEnabled_ = false;
30 virtualPageCountX_ = 0;
31 virtualPageCountY_ = 0;
32 virtualAtlasSlotsX_ = 0;
33 virtualAtlasSlotsY_ = 0;
34 virtualBorderFraction_ = 0.f;
35 pbr_.textures[0].texture = nullptr;
36 pbr_.textures[2].texture = nullptr;
37 height_ = nullptr;
39}
40
42 if (!virtualStreaming_)
44 invalidMaterial("enableVirtualTexture must be called before addVirtualTextureLayer"));
45 return virtualStreaming_->addLayer(layer);
46}
47
49 int pageCountX, int pageCountY, int atlasSlotsX, int atlasSlotsY,
50 float borderFraction) {
51 if (!albedoAtlas || !normalAtlas || !pageTable)
53 invalidMaterial("virtual texture requires albedo, normal, and page-table textures"));
54 if (pageCountX <= 0 || pageCountY <= 0 || atlasSlotsX <= 0 || atlasSlotsY <= 0)
56 invalidMaterial("virtual texture page and atlas dimensions must be positive"));
57 if (!std::isfinite(borderFraction) || borderFraction < 0.f || borderFraction >= 0.5f)
58 return eve::Result<void>::failure(invalidMaterial("virtual texture border fraction must be in [0, 0.5)"));
59 pbr_.textures[0].texture = albedoAtlas;
60 pbr_.textures[2].texture = normalAtlas;
61 height_ = pageTable;
62 virtualPageCountX_ = pageCountX;
63 virtualPageCountY_ = pageCountY;
64 virtualAtlasSlotsX_ = atlasSlotsX;
65 virtualAtlasSlotsY_ = atlasSlotsY;
66 virtualBorderFraction_ = borderFraction;
67 virtualTextureEnabled_ = true;
69}
70
72 virtualStreaming_.reset();
73 virtualStreamingEpoch_ = 0;
74 virtualStreamingInitialized_ = false;
75 virtualTextureEnabled_ = false;
76 virtualPageCountX_ = 0;
77 virtualPageCountY_ = 0;
78 virtualAtlasSlotsX_ = 0;
79 virtualAtlasSlotsY_ = 0;
80 virtualBorderFraction_ = 0.f;
81}
82
83eve::Result<void> Material::tickVirtualTexture(Graphics& gfx) const {
84 if (!virtualStreaming_) return eve::Result<void>::success();
85 const std::uint64_t epoch = gfx.mesh3dDrawEpoch();
86 if (virtualStreamingEpoch_ == epoch && virtualTextureEnabled_) return eve::Result<void>::success();
87 virtualStreamingEpoch_ = epoch;
88
89 // Bootstrap physical cache lazily after at least one layer is present.
90 if (!virtualStreamingInitialized_) {
91 auto initialized = virtualStreaming_->initializePhysicalCache();
92 if (!initialized.ok()) return initialized;
93 virtualStreamingInitialized_ = true;
94 }
95
96 // Engine-owned feedback: request the full mip-zero domain; decode budget + LRU stream residency.
97 const int pagesX = std::max(1, virtualStreaming_->pageCountX());
98 const int pagesY = std::max(1, virtualStreaming_->pageCountY());
99 auto feedback = virtualStreaming_->recordFeedbackGrid(pagesX, pagesY, 0);
100 if (!feedback.ok()) return feedback;
101 auto updated = virtualStreaming_->update();
102 if (!updated.ok()) return eve::Result<void>::failure(updated.status());
103 return virtualStreaming_->syncToMaterial(gfx, const_cast<Material&>(*this));
104}
105
106void Material::setShadingModel(const std::string& model) {
107 if (model == "unlit" || model == "hair" || model == "custom" || model == "pbr") {
108 shadingModel_ = model;
109 } else {
110 shadingModel_ = "pbr";
111 }
112 if (shadingModel_ == "hair") {
113 isHair_ = true;
114 surfaceMode_ = SurfaceMode::Transparent;
115 blendMode_ = BlendMode::Alpha;
116 doubleSided_ = true;
117 depthWrite_ = false;
118 castShadow_ = false;
119 alphaCutoff_ = 0.15f;
120 if (sortPriority_ == 0) sortPriority_ = 10;
121 }
122}
123
124void Material::setTint(float r, float g, float b, float a) {
125 r_ = r;
126 g_ = g;
127 b_ = b;
128 a_ = a;
129}
130
131void Material::setMetallic(float metallic) { metallic_ = metallic < 0.f ? 0.f : (metallic > 1.f ? 1.f : metallic); }
132
134 roughness_ = roughness < 0.04f ? 0.04f : (roughness > 1.f ? 1.f : roughness);
135}
136
137void Material::setTexCellBomb(float cellScale, float strength, float rotAmount) {
138 texBombScale_ = cellScale > 1e-3f ? cellScale : 1e-3f;
139 texBombStrength_ = strength < 0.f ? 0.f : (strength > 1.f ? 1.f : strength);
140 texBombRot_ = rotAmount < 0.f ? 0.f : (rotAmount > 1.f ? 1.f : rotAmount);
141}
142
143void Material::setParallax(float scale, float minLayers, float maxLayers) {
144 parallaxScale_ = scale < 0.f ? 0.f : (scale > 0.25f ? 0.25f : scale);
145 float minL = minLayers < 1.f ? 1.f : minLayers;
146 float maxL = maxLayers < minL ? minL : maxLayers;
147 if (maxL > 64.f) maxL = 64.f;
148 parallaxMinLayers_ = minL;
149 parallaxMaxLayers_ = maxL;
150}
151
152void Material::setHair(bool hair) {
153 isHair_ = hair;
154 if (hair) {
155 shadingModel_ = "hair";
156 surfaceMode_ = SurfaceMode::Transparent;
157 blendMode_ = BlendMode::Alpha;
158 doubleSided_ = true;
159 depthWrite_ = false;
160 castShadow_ = false;
161 alphaCutoff_ = 0.15f;
162 if (sortPriority_ == 0) sortPriority_ = 10;
163 }
164}
165
166void Material::setSurfaceMode(const std::string& mode) {
167 if (mode == "masked")
168 surfaceMode_ = SurfaceMode::Masked;
169 else if (mode == "transparent" || mode == "blend")
170 surfaceMode_ = SurfaceMode::Transparent;
171 else
172 surfaceMode_ = SurfaceMode::Opaque;
173}
174
175std::string Material::getSurfaceMode() const {
176 if (surfaceMode_ == SurfaceMode::Masked) return "masked";
177 if (surfaceMode_ == SurfaceMode::Transparent) return "transparent";
178 return "opaque";
179}
180
181void Material::setAlphaCutoff(float cutoff) { alphaCutoff_ = cutoff < 0.f ? 0.f : (cutoff > 1.f ? 1.f : cutoff); }
182
183void Material::setBlendMode(const std::string& mode) {
184 if (mode == "premultiplied" || mode == "premultiplied_alpha")
185 blendMode_ = BlendMode::Premultiplied;
186 else if (mode == "additive")
187 blendMode_ = BlendMode::Additive;
188 else if (mode == "multiply")
189 blendMode_ = BlendMode::Multiply;
190 else
191 blendMode_ = BlendMode::Alpha;
192}
193
194std::string Material::getBlendMode() const {
195 if (blendMode_ == BlendMode::Premultiplied) return "premultiplied";
196 if (blendMode_ == BlendMode::Additive) return "additive";
197 if (blendMode_ == BlendMode::Multiply) return "multiply";
198 return "alpha";
199}
200
201void Material::setAlphaTechnique(const std::string& technique) {
202 alphaTechnique_ = (technique == "dither" || technique == "coverage") ? technique : "cutoff";
203}
204
205bool Material::hasParam(const std::string& name) const { return params_.count(name) > 0; }
206
207void Material::setFloat(const std::string& name, float value) { params_[name] = value; }
208
209float Material::getFloat(const std::string& name) const {
210 auto it = params_.find(name);
211 return it == params_.end() ? 0.f : it->second;
212}
213
215 if (shadingModel_ == "custom") return shader_;
216 return shader_;
217}
218
219bool Material::isTransparentHair() const { return isHair_ || shadingModel_ == "hair"; }
220
222 auto valid = validatePbrSurface(surface);
223 if (!valid) return valid;
224 pbr_ = surface;
225 pbrEnabled_ = true;
226 setShadingModel(surface.unlit ? "unlit" : "pbr");
227 pbr_.unlit = false; // Shading mode is owned by shadingModel_; DTO snapshots derive it.
228 return Result<void>::success();
229}
230
231Result<void> Material::setFoliageTranslucency(float red, float green, float blue, float intensity, float strength,
232 float normalDistortion, float scattering, float direct, float ambient,
233 float shadow) {
234 auto candidate = pbr_;
235 candidate.translucency.color = {red, green, blue};
236 candidate.translucency.intensity = intensity;
237 candidate.translucency.strength = strength;
238 candidate.translucency.normalDistortion = normalDistortion;
239 candidate.translucency.scattering = scattering;
240 candidate.translucency.direct = direct;
241 candidate.translucency.ambient = ambient;
242 candidate.translucency.shadow = shadow;
243 candidate.vegetationColor.backfaceNormalMode = PbrVegetationBackfaceNormalMode::Flip;
244 auto accepted = setPbrSurface(candidate);
245 if (!accepted) return accepted;
246 doubleSided_ = true;
247 return Result<void>::success();
248}
249
251 auto candidate = pbr_;
252 candidate.clearcoatFactor = factor;
253 candidate.clearcoatRoughness = roughness;
254 return setPbrSurface(candidate);
255}
256
258 if (!std::isfinite(u) || !std::isfinite(v))
260 "albedo UV offset must be finite", {}, {}, "graphics.material"));
261 auto candidate = pbr_;
262 candidate.textures[std::size_t(PbrTextureSlot::BaseColor)].offset = {u, v};
263 return setPbrSurface(candidate);
264}
265
267 if (!std::isfinite(u) || !std::isfinite(v) || u == 0.f || v == 0.f)
269 "albedo UV scale must be finite and non-zero", {}, {},
270 "graphics.material"));
271 auto candidate = pbr_;
272 candidate.textures[std::size_t(PbrTextureSlot::BaseColor)].scale = {u, v};
273 return setPbrSurface(candidate);
274}
275
277 if (!std::isfinite(radians))
279 DiagnosticCode::InvalidArgument, "albedo UV rotation must be finite", {}, {}, "graphics.material"));
280 auto candidate = pbr_;
281 candidate.textures[std::size_t(PbrTextureSlot::BaseColor)].rotation = radians;
282 return setPbrSurface(candidate);
283}
284
285Result<void> Material::setFoliageWind(Texture* motionTexture, Texture* noiseTexture, float directionX, float directionZ,
286 float strength, float bending, float bendingSpeed, float branch,
287 float branchSpeed, float flutter, float flutterSpeed, float fadeDistance,
288 float bendFactor) {
289 const float directionLength = std::hypot(directionX, directionZ);
290 if (!motionTexture || !noiseTexture || !std::isfinite(directionLength) || directionLength <= .0001f ||
291 !std::isfinite(strength) || strength < 0 || !std::isfinite(bendFactor) || bendFactor < 0)
292 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "invalid foliage wind profile",
293 {}, {}, "graphics.foliage.wind"));
294 auto candidate = pbr_;
295 auto& motion = candidate.vegetationMotion;
296 motion.texture = motionTexture;
297 motion.noise = noiseTexture;
298 motion.usage.fill(0.f);
299 motion.fallback = {directionX / directionLength, directionZ / directionLength, strength, 0.f};
300 motion.globalDirection = {directionX / directionLength, directionZ / directionLength};
301 motion.bending = bending;
302 motion.bendingSpeed = bendingSpeed;
303 motion.branch = branch;
304 motion.branchSpeed = branchSpeed;
305 motion.flutter = flutter;
306 motion.flutterSpeed = flutterSpeed;
307 motion.globalBending = bendFactor;
308 motion.globalBranch = 1.f;
309 motion.globalFlutter = 1.f;
310 motion.noiseTiling = 1.f;
311 motion.fadeDistance = fadeDistance;
313 candidate.vegetationVertex.source = PbrVegetationDeformationSource::GpuFields;
314 return setPbrSurface(candidate);
315}
316
318 if (!std::isfinite(seconds) || std::abs(seconds) > 1e12 ||
321 "foliage wind is not configured or time is invalid", {}, {},
322 "graphics.foliage.wind"));
323 auto candidate = pbr_;
324 candidate.vegetationMotion.time = seconds;
325 return setPbrSurface(candidate);
326}
327
329 auto vtTick = tickVirtualTexture(gfx);
330 if (!vtTick.ok()) return vtTick;
331 auto snapshot = pbr_;
332 snapshot.unlit = shadingModel_ == "unlit";
333 auto pbrStatus = gfx.setMesh3DPbrSurface(pbrEnabled_ ? &snapshot : nullptr);
334 if (!pbrStatus) return pbrStatus;
335 const BlendMode effectiveBlend =
336 pbr_.textures[0].texture && pbr_.textures[0].texture->hasPremultipliedAlpha() && blendMode_ == BlendMode::Alpha
338 : blendMode_;
339 gfx.setMesh3DSurface(surfaceMode_, effectiveBlend, depthWrite_, doubleSided_, alphaCutoff_, alphaTechnique_);
340 gfx.setMesh3DMaterial(metallic_, roughness_);
341 gfx.setMesh3DTexCellBomb(texBombScale_, texBombStrength_, texBombRot_);
342 gfx.setMesh3DNormalTexture(pbr_.textures[2].texture);
343 gfx.setMesh3DPackedNormalMask(false);
344 gfx.setMesh3DHeightTexture(height_);
345 gfx.setMesh3DVirtualTexture(virtualTextureEnabled_, virtualPageCountX_, virtualPageCountY_, virtualAtlasSlotsX_,
346 virtualAtlasSlotsY_, virtualBorderFraction_);
347 gfx.setMesh3DParallax(parallaxScale_, parallaxMinLayers_, parallaxMaxLayers_);
348 gfx.setMesh3DShadowReceive(receiveShadow_);
349
350 if (!receiveLight_ || shadingModel_ == "unlit") {
351 // Cheap toggle only: never clobber the clustered light table that the
352 // frame uploaded once (see Graphics::setMesh3DClusteredActive).
353 gfx.setMesh3DClusteredActive(false);
354 Lighting3DPack none{};
355 none.count = 0;
356 none.ambient = glm::vec4(1.f, 1.f, 1.f, 0.f);
357 gfx.setMesh3DLighting(none);
358 }
359
360 if (shader_ && !params_.empty()) {
361 for (const auto& kv : params_) {
362 if (shader_->hasUniform(kv.first)) shader_->sendFloat(kv.first, kv.second);
363 }
364 }
365 return Result<void>::success();
366}
367
368} // namespace eve::graphics
std::string name
Definition ECS.cpp:154
float strength
std::string message
tensor::Graph g
Definition GpuGraph.cpp:7
float u
Definition Grass.cpp:233
double r
float v
std::array< float, 3 > scale
Snapshot snapshot
bool valid
MeleePoint3 b
Definition MeleeHit.cpp:41
MeleePoint3 a
Definition MeleeHit.cpp:40
float roughness
float metallic
uint64_t epoch
Definition OnnxGpgpu.cpp:28
TileLayer * layer
std::array< std::uint64_t, kPixelChunkSize *kPixelChunkSize > updated
Object::Ptr value
bool hair
glm::mat4 model
int created
Vec scattering
Vec feedback
A structured explanation of a failed, degraded, or noteworthy result.
Definition Diagnostic.h:94
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Move-only operation result carrying either a value or Status.
Definition Result.h:176
static Result success(T value)
Construct a successful result owning value.
Definition Result.h:185
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
virtual void setMesh3DMaterial(float metallic, float roughness)=0
Metallic (0..1) and roughness (0..1) for the next default mesh draw.
virtual Result< void > setMesh3DPbrSurface(const PbrSurface *surface)
Copy a validated extended surface for subsequent draws; null resets to legacy shading.
Definition Graphics.h:1253
virtual void setMesh3DPackedNormalMask(bool enabled)=0
Interpret normal texture RG as tangent XY, B as AO and A as smoothness for terrain surfaces.
virtual void setMesh3DClusteredActive(bool active)=0
Cheap per-draw toggle for the already-uploaded clustered light table. Unlike setMesh3DClusteredLighti...
virtual void setMesh3DTexCellBomb(float cellScale, float strength, float rotAmount=1.f)=0
Texture cell bombing for the next default mesh draw (breaks tiling). cellScale: cells per UV unit (ty...
virtual void setMesh3DParallax(float scale, float minLayers=8.f, float maxLayers=32.f)=0
Parallax occlusion mapping for the next default mesh draw. scale: UV displacement strength (0=off)....
virtual void setMesh3DVirtualTexture(bool enabled, int pageCountX, int pageCountY, int atlasSlotsX, int atlasSlotsY, float borderFraction)=0
Configure page-table sampling for the next mesh draw.
virtual void setMesh3DSurface(SurfaceMode mode, BlendMode blend, bool depthWrite, bool doubleSided, float alphaCutoff, const std::string &alphaTechnique="cutoff")=0
Select pipeline state for subsequent mesh draws.
virtual void setMesh3DShadowReceive(bool receive)=0
Per-draw: when false, shadow sampling is forced off for the next mesh draw.
std::uint64_t mesh3dDrawEpoch() const noexcept
Monotonic epoch advanced at the start of each render3D() submission. Materials use this to run virtua...
Definition Graphics.h:947
virtual void setMesh3DNormalTexture(Texture *normal)=0
Optional normal map for the next drawMesh / drawMeshShader (nullptr = flat).
virtual void setMesh3DHeightTexture(Texture *height)=0
Optional height map for parallax (R channel; nullptr = flat / off).
virtual void setMesh3DLighting(const Lighting3DPack &pack)=0
Per-frame ambient + up to 8 lights packed into Mesh3DUBO.
float getFloat(const std::string &name) const
Returns the float.
Definition Material.cpp:209
bool hasParam(const std::string &name) const
Optional named float knobs (style / custom shader params).
Definition Material.cpp:205
void setAlphaTechnique(const std::string &technique)
Optional masked transparency quality: "cutoff", "dither", "coverage".
Definition Material.cpp:201
void setBlendMode(const std::string &mode)
Set "alpha", "premultiplied", "additive", or "multiply".
Definition Material.cpp:183
std::string getBlendMode() const
Returns the blend mode.
Definition Material.cpp:194
void setMetallic(float metallic)
Sets the metallic.
Definition Material.cpp:131
Material()=default
Material.
Result< void > setAlbedoUvRotation(float radians)
Publish base-color UV rotation (radians, around UV origin) and enable PBR.
Definition Material.cpp:276
void clearVirtualTexture()
Restore conventional albedo/normal/height interpretation and drop any owned streaming session.
Definition Material.cpp:71
void setRoughness(float roughness)
Sets the roughness.
Definition Material.cpp:133
Result< void > setPbrSurface(const PbrSurface &surface)
Atomically replace validated PBR bindings and enable the extended forward path. Texture pointers are ...
Definition Material.cpp:221
bool isTransparentHair() const
True when this material should go through the hair transparent pass.
Definition Material.cpp:219
eve::Result< void > enableVirtualTexture(const VirtualTextureStreamingConfig &config)
Author a layered virtual texture; residency is driven automatically on bind.
Definition Material.cpp:23
void setAlphaCutoff(float cutoff)
Sets the alpha cutoff.
Definition Material.cpp:181
Result< void > setAlbedoUvOffset(float u, float v)
Publish base-color UV offset and enable the extended PBR surface path. Sampling uses ‘uv’ = rotate(uv...
Definition Material.cpp:257
eve::Result< void > setVirtualTexture(Texture *albedoAtlas, Texture *normalAtlas, Texture *pageTable, int pageCountX, int pageCountY, int atlasSlotsX, int atlasSlotsY, float borderFraction)
Opt this material into physical-atlas virtual-texture sampling. @ownership Internal Graphics upload p...
Definition Material.cpp:48
void setSurfaceMode(const std::string &mode)
Set "opaque", "masked", or "transparent" surface classification.
Definition Material.cpp:166
void setShadingModel(const std::string &model)
"pbr" | "unlit" | "hair" | "custom" (unknown → pbr).
Definition Material.cpp:106
void setTexCellBomb(float cellScale, float strength, float rotAmount=1.f)
Sets the tex cell bomb.
Definition Material.cpp:137
Result< void > setFoliageTranslucency(float red, float green, float blue, float intensity, float strength, float normalDistortion, float scattering, float direct, float ambient, float shadow)
Enable validated two-sided foliage translucency while preserving imported PBR textures and factors.
Definition Material.cpp:231
void setTint(float r, float g, float b, float a=1.f)
Sets the tint.
Definition Material.cpp:124
Result< void > setClearcoat(float factor, float roughness)
Publish clearcoat layer factors on the current PBR surface snapshot.
Definition Material.cpp:250
std::string getSurfaceMode() const
Returns the surface mode.
Definition Material.cpp:175
void setParallax(float scale, float minLayers=8.f, float maxLayers=32.f)
Sets the parallax.
Definition Material.cpp:143
Result< void > bind(Graphics &gfx) const
Push this material onto Graphics mesh3d state for the next draw. Does not issue the draw itself....
Definition Material.cpp:328
Result< void > setFoliageWindTime(float seconds)
Replace only the explicit foliage-motion time in the current material snapshot.
Definition Material.cpp:317
Result< void > setAlbedoUvScale(float u, float v)
Publish base-color UV scale (tiling) and enable the extended PBR surface path.
Definition Material.cpp:266
void setFloat(const std::string &name, float value)
Sets the float.
Definition Material.cpp:207
Shader * effectiveShader() const
Return the borrowed effective shader, or nullptr for the default PBR pipeline. @lifetime The pointer ...
Definition Material.cpp:214
Result< void > setFoliageWind(Texture *motionTexture, Texture *noiseTexture, float directionX, float directionZ, float strength, float bending, float bendingSpeed, float branch, float branchSpeed, float flutter, float flutterSpeed, float fadeDistance, float bendFactor)
Publish object-space foliage wind while preserving the current PBR material snapshot.
Definition Material.cpp:285
eve::Result< std::uint32_t > addVirtualTextureLayer(const VirtualTextureBlendLayer &layer)
Append one immutable source layer to the material-owned virtual texture.
Definition Material.cpp:41
void setHair(bool hair)
Sets the hair.
Definition Material.cpp:152
Custom GPU program.
Definition Shader.h:41
bool hasUniform(const std::string &name) const
Definition Shader.cpp:71
void sendFloat(const std::string &name, float x)
Definition Shader.cpp:107
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:15
static eve::Result< std::unique_ptr< VirtualTextureStreaming > > create(const VirtualTextureStreamingConfig &config)
Validate config and create an empty streaming session.
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Result< void > validatePbrSurface(const PbrSurface &s)
Validate finite material factors and sampler enums without changing the input.
BlendMode
Render-neutral 2D blend mode shared by graphics-facing modules.
Definition RenderTypes.h:11
Lighting3DPack public API.
Definition Light.h:171
Owning material parameter snapshot; texture pointers remain borrowed. Base color/metallic/roughness c...
Definition PbrSurface.h:240
PbrVegetationMotion vegetationMotion
Definition PbrSurface.h:281
std::array< PbrTextureBinding, std::size_t(PbrTextureSlot::Count)> textures
Definition PbrSurface.h:241
PbrTranslucency translucency
Per-light vegetation backlighting. Native ambient RGB supplies the GI term. Positive maskAmount with ...
Definition PbrSurface.h:275
std::array< float, 3 > color
Definition PbrSurface.h:62
PbrVegetationMotionMode mode
Definition PbrSurface.h:201
One immutable source layer copied into a VirtualTextureBlend.
Runtime streaming budgets over a VirtualTextureBlend producer.
glm::vec4 ambient