载入中...
搜索中...
未找到
FogSystem.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include "common/Result.h"
17
18#include <cstdint>
19#include <vector>
20
21#include <glm/mat4x4.hpp>
22#include <glm/vec3.hpp>
23
24namespace eve::graphics {
25class AtmosphereVolume;
26class Volumetric;
27}
28
29namespace eve::graphics::fog {
30
47public:
49 [[nodiscard]] FogQuality quality() const noexcept { return quality_; }
51 [[nodiscard]] FogQualityBudget budget() const noexcept { return budgetFor(quality_); }
53 [[nodiscard]] float simulationTime() const noexcept { return simTime_; }
55 [[nodiscard]] std::uint64_t frameIndex() const noexcept { return frameIndex_; }
56
58 FogDensityField& densityField() noexcept { return density_; }
60 const FogDensityField& densityField() const noexcept { return density_; }
62 FogProfile& profile() noexcept { return profile_; }
64 const FogProfile& profile() const noexcept { return profile_; }
66 SceneWind& wind() noexcept { return wind_; }
68 const SceneWind& wind() const noexcept { return wind_; }
70 MacFluidGrid& fluid() noexcept { return fluid_; }
72 const MacFluidGrid& fluid() const noexcept { return fluid_; }
74 FogInteractor& interactor() noexcept { return interactor_; }
76 const FogInteractor& interactor() const noexcept { return interactor_; }
78 BeerLightCache& beerCache() noexcept { return beerCache_; }
80 const BeerLightCache& beerCache() const noexcept { return beerCache_; }
82 ContinuousArt& art() noexcept { return art_; }
84 const ContinuousArt& art() const noexcept { return art_; }
85
87 [[nodiscard]] Result<void> setQuality(FogQuality quality);
88
93 [[nodiscard]] Result<void> configureDomain(int simWidth, int simHeight, int simDepth,
94 const FogWorldBounds& bounds, float fixedDt = 1.f / 60.f);
95
97 [[nodiscard]] Result<void> seedHeightFog(float baseDensity, float baseHeight, float falloff,
98 float curlScale, std::uint32_t seed = 1u);
99
103 [[nodiscard]] Result<FogCflReport> stepSimulation(float dt);
104
108 [[nodiscard]] Result<void> ensureBeerCache(const glm::vec3& lightDir, const glm::vec3& lightColor,
109 float intensity);
110
112 [[nodiscard]] Result<FogRayResult> marchRay(const glm::vec3& origin, const glm::vec3& direction,
113 const FogVolumeBound& bound, const glm::vec3& lightDir,
114 const glm::vec3& lightColor, float lightIntensity,
115 const glm::vec3& skyAmbient, const glm::vec3& groundAmbient,
116 float sceneDepth) const;
117
119 [[nodiscard]] Result<int> renderToFroxel(AtmosphereVolume& volume, const glm::mat4& invViewProj,
120 const glm::vec3& lightDir, const glm::vec3& lightColor,
121 float intensity);
122
131 [[nodiscard]] Result<int> injectToFroxel(AtmosphereVolume& volume, const glm::mat4& invViewProj);
132
142 [[nodiscard]] Result<int> injectToVolumetric(Volumetric* volumetric);
143
155 [[nodiscard]] Result<int> syncToVolumetric(Volumetric* volumetric, const glm::vec3& lightDir,
156 const glm::vec3& lightColor, float intensity);
157
159 [[nodiscard]] Result<FogRayResult> integrateBeam(const AnalyticBeam& beam, const glm::vec3& origin,
160 const glm::vec3& direction, float sceneDepth,
161 float mediumDensity) const;
162
164 [[nodiscard]] Result<std::vector<DustParticle>> generateDust(int count, float turbulenceMeters,
165 std::uint32_t seed = 7u) const;
166
168 [[nodiscard]] ContinuousArtOutput stylize(const FogRayResult& physical, float viewZ,
169 float neighborOpacity = 0.f) const noexcept;
170
171private:
172 FogQuality quality_ = FogQuality::Enhanced;
173 float simTime_ = 0.f;
174 std::uint64_t frameIndex_ = 0;
175 FogDensityField density_;
176 FogProfile profile_;
177 SceneWind wind_;
178 MacFluidGrid fluid_;
179 FogInteractor interactor_;
180 BeerLightCache beerCache_;
181 FogRayMarch rayMarch_;
182 FogFroxelBridge froxelBridge_;
183 AnalyticalVolLight volLight_;
184 ProceduralDust dust_;
185 ContinuousArt art_;
186};
187
188} // namespace eve::graphics::fog
double volume
#define EVENGINE_API_WORLD
Definition Export.h:109
float f
std::uint32_t seed
Definition PointSet.cpp:807
Move-only, checked operation results for the common layer.
V3 origin
Definition RoadBake.cpp:138
RoadLaneDirection direction
std::uint32_t count
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Camera-frustum volume used by the volumetric fog passes and CPU references.
Volumetric light + fog.
Definition Volumetric.h:38
Analytic volumetric light: ray ∩ capped frustum, depth-clipped short integral.
Cached light-path transmittance used by Fast / Enhanced quality tiers.
Post-physics stylization layer.
World-space density bands, curl assist velocity, and lighting helpers.
Maps world-space density into a camera froxel volume and integrates it.
Analytic solid proxies that carve fog and inject wake into the MAC field.
Unit-density optical profile for participating media.
Definition FogProfile.h:16
World-space fog ray marcher with Beer–Lambert extinction and HG phase.
Definition FogRayMarch.h:38
Orchestrates density, MAC transport, optics, froxel mapping, and art.
Definition FogSystem.h:46
FogInteractor & interactor() noexcept
Interactor.
Definition FogSystem.h:74
BeerLightCache & beerCache() noexcept
Beer cache.
Definition FogSystem.h:78
const BeerLightCache & beerCache() const noexcept
Beer cache.
Definition FogSystem.h:80
MacFluidGrid & fluid() noexcept
Fluid.
Definition FogSystem.h:70
FogQuality quality() const noexcept
Quality.
Definition FogSystem.h:49
const FogInteractor & interactor() const noexcept
Interactor.
Definition FogSystem.h:76
ContinuousArt & art() noexcept
Art.
Definition FogSystem.h:82
std::uint64_t frameIndex() const noexcept
Frame index.
Definition FogSystem.h:55
FogDensityField & densityField() noexcept
Density field.
Definition FogSystem.h:58
const SceneWind & wind() const noexcept
Wind.
Definition FogSystem.h:68
FogProfile & profile() noexcept
Profile.
Definition FogSystem.h:62
FogQualityBudget budget() const noexcept
Budget.
Definition FogSystem.h:51
const ContinuousArt & art() const noexcept
Art.
Definition FogSystem.h:84
const FogDensityField & densityField() const noexcept
Density field.
Definition FogSystem.h:60
SceneWind & wind() noexcept
Wind.
Definition FogSystem.h:66
const MacFluidGrid & fluid() const noexcept
Fluid.
Definition FogSystem.h:72
float simulationTime() const noexcept
Simulation time.
Definition FogSystem.h:53
const FogProfile & profile() const noexcept
Profile.
Definition FogSystem.h:64
MAC (Marker-And-Cell) staggered-grid Eulerian fog fluid.
Procedural dust that does not use persistent particle buffers or screen trails.
World-space wind provider for MAC fog transport.
Definition SceneWind.h:18
FogQualityBudget budgetFor(FogQuality quality) noexcept
Resolve the budget for a quality preset.
Definition FogTypes.h:52
FogQuality
Tracking / cache / skip budget for the realtime fog pipeline.
Definition FogTypes.h:13
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Analytic beam volume: capped cone frustum or pyramidal spot.
Stylized fog presentation derived from a physical FogRayResult.
Definition FogTypes.h:169
Resource / sample budget derived from a quality preset.
Definition FogTypes.h:38
Optical result of integrating one view ray through fog.
Definition FogTypes.h:122
Analytic volume used to bound a camera ray before sampling.
Definition FogRayMarch.h:17
Axis-aligned world bounds for a fog simulation domain.
Definition FogTypes.h:96
glm::vec4 lightColor
glm::vec4 lightDir
glm::mat4 invViewProj
glm::vec4 bounds