载入中...
搜索中...
未找到
VegetationFieldGpu.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include <array>
5#include <cstdint>
6#include <glm/vec3.hpp>
7#include <span>
8#include "common/Result.h"
9
10namespace eve::graphics {
11
12class IResourceFactory;
13class Texture;
14class VegetationField;
15struct PbrSurface;
16struct VegetationAtlas;
17struct VegetationChannelAtlas;
18
24 Texture* texture = nullptr;
25 uint64_t fieldRevision = 0;
26 uint32_t width = 0, height = 0, layers = 0;
27 glm::vec3 center{0.f}, extent{1.f};
28};
33
44
49 Texture* motionNoise = nullptr;
50 Texture* fadeNoise = nullptr;
51 std::array<float, 2> motionDirection{1, 0};
52 std::array<float, 3> worldOrigin{0, 0, 0};
53 double time = 0;
55 float motionFadeDistance = 100;
57 bool enableMotion = true;
58};
59
72 IResourceFactory& factory, const VegetationField& field, glm::vec3 center, glm::vec3 extent, uint32_t width,
73 uint32_t height, bool snapToTexel = true);
74
79 IResourceFactory& factory, const VegetationField& field, glm::vec3 center, glm::vec3 extent, uint32_t width,
80 uint32_t height, bool snapToTexel = true);
81
84 IResourceFactory& factory, const VegetationField& field, glm::vec3 center, glm::vec3 extent, uint32_t width,
85 uint32_t height, bool snapToTexel = true);
86
89 IResourceFactory& factory, const VegetationField& field, glm::vec3 center, glm::vec3 extent, uint32_t width,
90 uint32_t height, bool snapToTexel = true);
91
99 IResourceFactory& factory, const VegetationField& field, glm::vec3 center, glm::vec3 extent, uint32_t width,
100 uint32_t height, bool snapToTexel = true);
101
109 IResourceFactory& factory, std::span<const VegetationAtlas, 9> layers, std::uint64_t sourceRevision);
110
116 IResourceFactory& factory, std::span<const VegetationChannelAtlas, 9> colors,
117 std::span<const VegetationChannelAtlas, 9> extras, std::span<const VegetationChannelAtlas, 9> motion,
118 std::span<const VegetationChannelAtlas, 9> vertex, std::uint64_t sourceRevision);
119
128
141 PbrSurface& surface, const VegetationField& field, const VegetationExtrasGpuAtlas& extras,
143 const VegetationVertexGpuAtlas& vertex, const VegetationGpuRuntime& runtime);
144
147 const VegetationField& field,
148 const VegetationGpuFieldSet& set,
149 const VegetationGpuRuntime& runtime);
150
153 const VegetationGpuFieldSet& set,
154 std::uint64_t expectedRevision,
155 const VegetationGpuRuntime& runtime);
156
157} // namespace eve::graphics
#define EVENGINE_API_BACKENDS
Definition Export.h:108
std::uint32_t height
std::uint32_t width
Move-only, checked operation results for the common layer.
std::vector< float > colors
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Texture / mesh / shader / canvas creation and release.
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
Backend-independent, owning vegetation influence field. Single writer; concurrent const evaluation is...
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Result< void > releaseVegetationGpuFieldSet(IResourceFactory &factory, VegetationGpuFieldSet &set)
Release every texture still present in a detached field set. Successful entries are nulled....
Result< VegetationGpuFieldSet > uploadVegetationGpuFieldSet(IResourceFactory &factory, const VegetationField &field, glm::vec3 center, glm::vec3 extent, uint32_t width, uint32_t height, bool snapToTexel)
Bake and upload all four nine-layer projections as one publication. Earlier uploads are released if a...
Result< void > bindVegetationGpuFields(PbrSurface &surface, const VegetationField &field, const VegetationExtrasGpuAtlas &extras, const VegetationColorsGpuAtlas &colors, const VegetationMotionGpuAtlas &motion, const VegetationVertexGpuAtlas &vertex, const VegetationGpuRuntime &runtime)
Atomically bind four coherent GPU projections to an owning PBR parameter snapshot.
Result< VegetationExtrasGpuAtlas > uploadVegetationExtrasAtlas(IResourceFactory &factory, const VegetationField &field, glm::vec3 center, glm::vec3 extent, uint32_t width, uint32_t height, bool snapToTexel)
Bake and atomically upload all nine Extras layers as a linear RGBA16F 2D array.
Result< VegetationVertexGpuAtlas > uploadVegetationVertexAtlas(IResourceFactory &factory, const VegetationField &field, glm::vec3 center, glm::vec3 extent, uint32_t width, uint32_t height, bool snapToTexel)
Bake and atomically upload all nine Vertex layers as a linear RGBA16F 2D array.
Result< VegetationMotionGpuAtlas > uploadVegetationMotionAtlas(IResourceFactory &factory, const VegetationField &field, glm::vec3 center, glm::vec3 extent, uint32_t width, uint32_t height, bool snapToTexel)
Bake and atomically upload all nine Motion layers as a linear RGBA16F 2D array.
Result< VegetationColorsGpuAtlas > uploadVegetationColorsAtlas(IResourceFactory &factory, const VegetationField &field, glm::vec3 center, glm::vec3 extent, uint32_t width, uint32_t height, bool snapToTexel)
Bake and atomically upload all nine Colors layers as a linear RGBA16F 2D array. Ownership,...
Owning material parameter snapshot; texture pointers remain borrowed. Base color/metallic/roughness c...
Definition PbrSurface.h:218
Immutable GPU projection of nine layers from one vegetation field channel. The source field remains a...
Coherent detached projections for all four vegetation channels. Textures are factory-owned....
Runtime-owned global inputs shared by one coherent vegetation field binding. Time is explicit for det...