载入中...
搜索中...
未找到
VegetationRender.cpp
浏览该文件的文档.
13 return Diagnostic::error(DiagnosticCode::InvalidArgument, "invalid vegetation render data", {}, {},
18 return std::isfinite(value.x) && std::isfinite(value.y) && std::isfinite(value.z) && std::isfinite(value.w);
25 if (vertices.empty() || vertices.size() > 4 * 1024 * 1024 || texcoords.size() != vertices.size() * 2 ||
41 if (!graphics.updateMeshVertices(&mesh, data.positions.data(), data.normals.data(), texcoords.data(),
44 DiagnosticCode::Unsupported, "backend rejected vegetation mesh update", {}, {}, "graphics.vegetation"));
59 !unit(surface.overlaySmoothness) || !unit(surface.wetnessCoverage) || !unit(surface.wetnessContrast) ||
63 !unit(surface.wetnessNormalScale) || !unit(surface.overlaySubsurface) || !unit(surface.alphaCutoff) ||
64 !unit(surface.colorsCoverage) || !std::isfinite(surface.colorsIntensity) || surface.colorsIntensity < 0 ||
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Definition Graphics.h:125
virtual bool updateMeshVertices(Mesh *mesh, const float *posXYZ, const float *nrmXYZ, const float *uvST, int vertexCount, const uint32_t *indices, int indexCount)=0
In-place update of a mesh's vertex/index data (CPU -> host-visible VBO). Mirrors bakeMeshMorph: the u...
Packages shading method + surface parameters into one attachable asset.
Definition Material.h:35
PbrSurface pbrSurface() const
Return an owning parameter snapshot; texture resources remain borrowed.
Definition Material.h:58
Result< void > setPbrSurface(const PbrSurface &surface)
Atomically replace validated PBR bindings and enable the extended forward path. Texture pointers are ...
Definition Material.cpp:164
void setSurfaceMode(const std::string &mode)
Set "opaque", "masked", or "transparent" surface classification.
Definition Material.cpp:109
Result< void > adoptVegetationFactors(std::vector< float > &&values)
Validate and take ownership of interleaved vegetation variation/occlusion pairs.
Definition MeshTangent.cpp:19
void computeBounds(const float *posXYZ, int vertexCount)
Compute the bounding sphere (centroid + max radius) from positions.
Definition Mesh.cpp:93
Result< void > validateMotionHighlights(std::span< const float > values) const
Validate an optional per-vertex motion-highlight stream without mutation.
Definition MeshTangent.cpp:51
Result< void > adoptTangentFrame(std::vector< float > &&tangents, std::vector< float > &&bitangents)
Validate then take owning frame buffers without allocating on success.
Definition MeshTangent.cpp:93
Result< void > validateVegetationFactors(std::span< const float > values) const
Validate optional interleaved vegetation variation/occlusion pairs without mutation.
Definition MeshTangent.cpp:6
Result< void > adoptMotionHighlights(std::vector< float > &&values)
Validate and transfer an owning motion-highlight stream without allocating on success.
Definition MeshTangent.cpp:63
Result< void > validateTangentFrame(std::span< const float > tangents, std::span< const float > bitangents) const
Validate a frame against current vertex count without mutation or allocation on success.
Definition MeshTangent.cpp:69
Backend-independent, owning vegetation influence field. Single writer; concurrent const evaluation is...
Definition VegetationField.h:86
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Result< void > applyVegetationSurface(Material &material, const VegetationSample &sample, const VegetationSurface &surface)
Apply an independently sampled field to a masked double-sided PBR material. Render-thread only,...
Definition VegetationRender.cpp:56
Result< VegetationGeometry > deformVegetation(const VegetationField &field, std::span< const VegetationVertex > vertices, const VegetationMotion &motion)
Evaluate plant bending, squash, rolling, flutter, interaction and perspective. Worker-safe with immut...
Definition VegetationMotion.cpp:185
Result< void > updateVegetationMesh(Graphics &graphics, Mesh &mesh, const VegetationField &field, std::span< const VegetationVertex > vertices, const VegetationMotion &motion, std::span< const float > texcoords, std::span< const uint32_t > indices)
Deform rest geometry then update an existing mesh through the active Graphics backend....
Definition VegetationRender.cpp:22
@ InvalidArgument
@ Unsupported
PbrVegetationColorStages vegetationColor
Definition PbrSurface.h:254
std::array< float, 4 > fieldColor
Definition PbrSurface.h:83
Source-equivalent plant motion parameters with explicit time and texture inputs. All data is owned....
Definition VegetationMotion.h:38
Owning sampled field channels; no lifetime dependency on the field.
Definition VegetationField.h:61
Owning surface inputs, supplied afresh to avoid accumulating tint/wetness across frames....
Definition VegetationRender.h:24
float overlaySmoothness
Definition VegetationRender.h:27
bool invertVertexOcclusionColors
Definition VegetationRender.h:34
float wetnessContrast
Definition VegetationRender.h:28
float overlayProjection
Definition VegetationRender.h:29
float overlayNormalScale
Definition VegetationRender.h:30
float colorsVariation
Definition VegetationRender.h:32
float vertexOcclusionMaximum
Definition VegetationRender.h:33
float wetnessCoverage
Definition VegetationRender.h:28
std::array< float, 3 > vertexOcclusionColor
Definition VegetationRender.h:26
float vertexOcclusionAlpha
Definition VegetationRender.h:29
float wetnessNormalScale
Definition VegetationRender.h:30
float vertexOcclusionMinimum
Definition VegetationRender.h:33
float overlayVariation
Definition VegetationRender.h:28
bool invertVertexOcclusion
Definition VegetationRender.h:34
PbrVegetationBackfaceNormalMode backfaceNormalMode
Definition VegetationRender.h:35
std::array< float, 3 > emission
Definition VegetationRender.h:26
float colorsCoverage
Definition VegetationRender.h:32
float overlaySubsurface
Definition VegetationRender.h:31
float overlayCoverage
Definition VegetationRender.h:28
std::array< float, 3 > overlayColor
Definition VegetationRender.h:26
std::array< float, 4 > albedo
Definition VegetationRender.h:25
float colorsIntensity
Definition VegetationRender.h:32