载入中...
搜索中...
未找到
GpuParticles.h
浏览该文件的文档.
1#pragma once
2
4
5#include <cstdint>
6
7namespace eve::graphics {
8
9class Texture;
10
12enum class GpuParticleFacingMode : std::uint32_t {
14 Velocity = 1,
15 Axis = 2,
17 Ribbon = 3,
18};
19
27enum class GpuParticleSortMode : std::uint32_t {
28 None = 0,
29 Oldest = 1,
30 Youngest = 2,
31 Distance = 3,
32 Birth = 4,
33};
34
36using GpuParticleHandle = std::uint64_t;
37
40
42struct alignas(16) GpuParticleSpawn {
43 float x = 0.f;
44 float y = 0.f;
45 float vx = 0.f;
46 float vy = 0.f;
47 float life = 0.f;
48 float lifetime = 1.f;
49 float size = 1.f;
50 float rotation = 0.f;
51 float spin = 0.f;
52 float frame = 0.f;
53 float radial = 0.f;
54 float tangential = 0.f;
55 float ax = 0.f;
56 float ay = 0.f;
57 float noisePhase = 0.f;
59 float birthSerial = 0.f;
60};
61
62static_assert(sizeof(GpuParticleSpawn) == 64, "GPU particle layout must match GLSL std430");
63
66 float dt = 0.f;
67 float emitterX = 0.f;
68 float emitterY = 0.f;
69 float gravityX = 0.f;
70 float gravityY = 0.f;
71 float damping = 0.f;
72 float velocityLimit = 0.f;
73 float noiseStrength = 0.f;
74 float noiseFrequency = 1.f;
75 float noiseSpeed = 0.f;
76 float time = 0.f;
77 float frameRate = 0.f;
78 float localOffsetX = 0.f;
79 float localOffsetY = 0.f;
80};
81
84 Texture* texture = nullptr;
85 Texture* sceneDepth = nullptr;
87 float viewportWidth = 1.f;
88 float viewportHeight = 1.f;
89 float cameraX = 0.f;
90 float cameraY = 0.f;
91 float cameraZoom = 1.f;
92 bool cameraEnabled = false;
93 float particleWidth = 1.f;
94 float particleHeight = 1.f;
95 float sizeStart = 1.f;
96 float sizeEnd = 1.f;
97 float stretchFactor = 1.f;
101 float ribbonWidth = 1.f;
103 bool softParticles = false;
104 float particleDepth = 0.5f;
105 float softFadeDistance = 0.05f;
106 float colorStart[4] = {1.f, 1.f, 1.f, 1.f};
107 float colorEnd[4] = {1.f, 1.f, 1.f, 0.f};
108 int hframes = 1;
109 int vframes = 1;
110};
111
114 std::uint32_t alive = 0;
116 std::uint32_t instances = 0;
117 std::uint32_t spawned = 0;
118 std::uint32_t killed = 0;
119 std::uint32_t dropped = 0;
120 std::uint64_t submittedFrames = 0;
121};
122
123} // namespace eve::graphics
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
std::uint64_t GpuParticleHandle
Opaque backend-owned GPU particle emitter handle.
constexpr GpuParticleHandle kInvalidGpuParticleHandle
Invalid GPU particle handle returned when the backend cannot allocate the resource.
GpuParticleFacingMode
Sprite orientation supported by the resident GPU particle renderer.
@ Ribbon
Connect birth-ordered neighbors into ribbon segments.
GpuParticleSortMode
Transparent ordering for the resident GPU particle renderer.
BlendMode
Render-neutral 2D blend mode shared by graphics-facing modules.
Definition RenderTypes.h:11
Parameters for rendering a resident GPU particle emitter.
GpuParticleSortMode sortMode
GpuParticleFacingMode facing
GPU particle state uploaded only for newly spawned particles.
float birthSerial
Monotonic birth serial (uintBitsToFloat) for future ribbon ordering.
Delayed non-blocking counters from a resident GPU emitter.
std::uint32_t instances
Instance count written into the most recently completed indirect command.
Parameters for one resident GPU simulation step.