载入中...
搜索中...
未找到
WaterUnderwaterEffects.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Result.h"
4
5#include <cstdint>
6#include <vector>
7
8#include <glm/glm.hpp>
9
10namespace ssq { class Table; }
11
12namespace eve::graphics {
13class Volumetric;
14class Camera3D;
15class Graphics;
16class Renderable3D;
17
19struct UnderwaterColorStop { float time = 0.0F; glm::vec3 color{1.0F}; };
20
23public:
25 [[nodiscard]] Result<void> addStop(float time, float r, float g, float b);
27 void clear() { stops_.clear(); }
29 [[nodiscard]] Result<glm::vec3> evaluate(float time) const;
30 private:
31 std::vector<UnderwaterColorStop> stops_;
32};
33
36public:
38 [[nodiscard]] Result<void> addKey(float time, float value);
40 void clear() { keys_.clear(); }
42 [[nodiscard]] Result<float> evaluate(float time) const;
43 private:
44 std::vector<glm::vec2> keys_;
45};
46
49 bool enabled = true;
50 bool supportFog = true;
51 bool supportPostFx = true;
52 bool enableTransitionFx = true;
53 bool useCaustics = true;
54 bool hdrp = false;
55 bool overrideFogColor = false;
56 float fogDepth = 100.0F;
57 float fogDistance = 45.0F;
58 float hdrpFogDistance = 30.0F;
59 float nearFogDistance = -4.0F;
60 float fogDensity = 0.045F;
61 float playbackVolume = 0.5F;
62 float causticSize = 15.0F;
65 glm::vec3 fogColorMultiplier{0.0F};
67 glm::vec3 photoModeFogColor{0.0F};
68 glm::vec3 overrideFogMultiplier{1.0F};
69 float overrideFogCurve = 1.0F;
70 float anisotropyShallow = 0.225F;
71 float anisotropyDeep = 0.0F;
72 bool timeDrivenPostFx = false;
74 glm::vec3 constantPostColor{1.0F};
75 float transitionHalfHeight = 0.025F;
77 float transitionVignette = 0.25F;
80 float transitionLensScale = 1.02F;
81 glm::vec3 transitionLift{-0.020152892F, -0.009343888F, 0.005069838F};
82 glm::vec3 transitionInverseGamma{1.35160142F, 1.35531419F, 1.26800077F};
83 glm::vec3 transitionGain{0.67146943F, 0.68969287F, 0.72298255F};
84 glm::vec3 transitionColorFilter{0.0F};
85};
86
89 float cameraY = 0.0F;
90 float seaLevel = 50.0F;
91 float timeOfDay = 0.5F;
92 glm::vec3 mainLightColor{1.0F};
93 bool hasMainLight = true;
94 int causticTicks = 0;
95};
96
98struct WaterUnderwaterState { bool initialized = false; bool isUnderwater = false; int causticFrame = 0; };
99
102
105 int sensorTag = 0;
106 int visitorTag = 0;
107 bool entered = false;
108 bool exited = false;
109};
110
113 bool isUnderwater = false;
114 bool entered = false;
115 bool exited = false;
116 bool playSubmergeDown = false;
117 bool playSubmergeUp = false;
118 bool loopAudio = false;
119 bool particles = false;
120 bool horizon = false;
121 bool surfaceVfx = true;
122 bool postFx = false;
123 bool transitionFx = false;
124 bool caustics = false;
126 float causticSize = 0.0F;
127 glm::vec3 fogColor{0.533F, 0.764F, 1.0F};
128 float fogDensity = 0.0F;
129 float fogStart = 0.0F;
130 float fogEnd = 0.0F;
131 float fogHeight = 0.0F;
132 float depth01 = 0.0F;
133 float hdrpBaseHeight = -150.0F;
134 float hdrpMeanFreePath = 3000.0F;
135 float hdrpProbeDimmer = 1.0F;
136 float hdrpAnisotropy = 0.225F;
137 float hdrpDepthExtent = 150.0F;
138 float postExposure = 0.0F;
139 glm::vec3 postColor{1.0F};
140 glm::vec3 underwaterMaterialColor{0.8117647F};
141 float transitionWeight = 0.0F;
142 float transitionVignette = 0.0F;
146 glm::vec3 transitionLift{0.0F};
147 glm::vec3 transitionInverseGamma{1.0F};
148 glm::vec3 transitionGain{1.0F};
149 glm::vec3 transitionColorFilter{1.0F};
150};
151
154 glm::vec3 color{0.55F, 0.58F, 0.62F};
155 float density = 0.004F;
156 float start = 2.0F;
157 float end = 90.0F;
158 float height = 0.0F;
159 float heightFalloff = 0.04F;
160};
161
164 float exposureEv = 0.0F;
165 glm::vec3 color{1.0F};
166 float vignette = 0.0F;
167 float vignetteSmoothness = 0.2F;
168 float lensDistortion = 0.0F;
169 float lensScale = 1.0F;
170 glm::vec3 lift{0.0F};
171 glm::vec3 inverseGamma{1.0F};
172 glm::vec3 gain{1.0F};
173};
174
177 glm::vec3 color{1.0F};
178 float alpha = 1.0F;
179};
180
194 const WaterUnderwaterInput& input, const UnderwaterColorGradient& depthGradient,
195 const UnderwaterColorGradient& timeGradient, const UnderwaterScalarCurve& postExposureCurve,
196 const UnderwaterColorGradient& postColorGradient);
197
208 WaterUnderwaterDisableTriggerState& state, const WaterUnderwaterTriggerEvent& event, int expectedSensorTag,
209 int expectedVisitorTag);
210
221 const WaterSurfaceFogSnapshot& surface);
222
234 const WaterSurfacePostFxSnapshot& surface);
235
245
255 Renderable3D* renderable, const WaterUnderwaterOutput& output, const WaterSurfaceMaterialSnapshot& surface);
256
258void exposeWaterUnderwaterEffectsBindings(ssq::Table& table);
259
260} // namespace eve::graphics
double value
std::string output
EvpackChunkInput input
Definition Evpack.cpp:170
#define EVENGINE_API_BACKENDS
Definition Export.h:108
tensor::Graph g
Definition GpuGraph.cpp:7
double r
MeleePoint3 b
Definition MeleeHit.cpp:41
Move-only, checked operation results for the common layer.
TerrainThermalSettings settings
Move-only operation result carrying either a value or Status.
Definition Result.h:155
EVENGINE_API_BACKENDS public API.
EVENGINE_API_BACKENDS public API.
Caller-owned ordered color gradient used for depth or time-of-day fog.
Caller-owned normalized scalar curve used by Pcg underwater post exposure.
Volumetric light + fog.
Definition Volumetric.h:38
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Result< void > applyWaterUnderwaterHorizon(Renderable3D *horizon, const WaterUnderwaterOutput &output)
Synchronize Pcg's underwater horizon mesh visibility.
Result< void > applyWaterUnderwaterMaterial(Renderable3D *renderable, const WaterUnderwaterOutput &output, const WaterSurfaceMaterialSnapshot &surface)
Apply Pcg's per-frame underwater material color to a dedicated water renderable.
Result< void > applyWaterUnderwaterFog(Volumetric *volumetric, const WaterUnderwaterOutput &output, const WaterSurfaceFogSnapshot &surface)
Apply a water-effects snapshot to an existing EVEngine volumetric fog provider.
Result< void > advanceWaterUnderwaterDisableTrigger(WaterUnderwaterDisableTriggerState &state, const WaterUnderwaterTriggerEvent &event, int expectedSensorTag, int expectedVisitorTag)
Apply one Box3D trigger event using Pcg DisableUnderwaterFXTrigger semantics.
Result< void > applyWaterUnderwaterPostFx(Graphics *graphics, Camera3D *camera, const WaterUnderwaterOutput &output, const WaterSurfacePostFxSnapshot &surface)
Apply underwater exposure and final-composite color to borrowed graphics providers.
void exposeWaterUnderwaterEffectsBindings(ssq::Table &table)
Register underwater-effects value types and checked transition with the VM owner thread.
Result< void > advanceWaterUnderwaterEffects(WaterUnderwaterState &state, WaterUnderwaterOutput &output, const WaterUnderwaterSettings &settings, const WaterUnderwaterInput &input, const UnderwaterColorGradient &depthGradient, const UnderwaterColorGradient &timeGradient, const UnderwaterScalarCurve &postExposureCurve, const UnderwaterColorGradient &postColorGradient)
Advance Pcg underwater transitions and derive provider-neutral effects.
enum EVENGINE_API_FOUNDATION Table
OT_TABLE (editable via Runtime table APIs / ReflectedPropertyModel).
Definition Runtime.h:121
EVEngine ECS 集成层:底层实现使用 sunxfancy/ECS.hpp https://github.com/sunxfancy/ECS.hpp
Definition ECS.h:14
One normalized RGB key in a Pcg underwater fog gradient.
Caller-owned surface fog values restored after leaving or disabling underwater effects.
Caller-owned water-renderable tint restored outside the underwater state.
Caller-owned surface post-processing values restored above water.
Caller-owned enable state driven by Pcg disable-underwater trigger events.
Immutable per-frame water, camera and lighting snapshot.
Effects snapshot for graphics, audio, particles and VFX providers to consume.
Authored Pcg underwater-effects policy; owns no renderer, audio source or scene object.
Persistent caller-owned transition and caustic animation state.
Immutable normalized 3D trigger event snapshot supplied by the physics owner.