载入中...
搜索中...
未找到
SkyAtmospherePass.h
浏览该文件的文档.
1#pragma once
2#include <array>
3#include <glm/mat4x4.hpp>
4#include <glm/vec3.hpp>
5#include <memory>
6#include "common/Export.h"
7#include "common/Result.h"
8
9namespace eve::graphics {
10class Graphics;
11struct SkyWispsLayer;
12
20 std::array<float, 2> directionalElevationRange{0, 0};
21 float densityPerMetre = 0;
22 float heightFalloffPerMetre = .006f;
23 float baseHeightMetres = -1.5f;
24 float startDistanceMetres = 73.4803369f;
25 std::array<float, 3> inscattering{0, 0, 0};
26 float maximumOpacity = 1;
27 std::array<float, 3> directionalInscattering{.78809762f, .64244735f, .55544519f};
31 float skyDistanceMetres = 100000;
33 [[nodiscard]] EVENGINE_API_BACKENDS Result<void> validate() const;
34};
35
40 std::array<float, 3> rayleigh{.0067450796f, .0163137194f, .04f};
42 std::array<float, 3> mieScattering{.0112259542f, .0123162284f, .013996f};
43 float mieHeightKm = 1.2f;
44 std::array<float, 3> mieAbsorption{.000444f, .000444f, .000444f};
45 float mieAnisotropy = .75f;
46 std::array<float, 3> ozoneAbsorption{.001794476f, .002f, .000190614f};
47 float ozoneCenterKm = 25;
48 float ozoneHalfWidthKm = 15;
49 float groundRadiusKm = 6360;
51 std::array<float, 3> groundAlbedo{.40197778f, .40197778f, .40197778f};
55 [[nodiscard]] EVENGINE_API_BACKENDS Result<void> validate() const;
56};
57
60 glm::vec3 direction{-.5f, .8660254f, 0};
61 glm::vec3 irradiance{5.f};
62};
63
67 float wispsMorphPhase = 0; // Normalized periodic phase in [0,1).
69 float dayPhase = 0;
70};
71
87public:
94 [[nodiscard]] static Result<std::unique_ptr<SkyAtmospherePass>> prepare(Graphics& graphics,
95 const SkyAtmosphereParameters& parameters,
96 const SkyWispsLayer* wisps = nullptr);
101 [[nodiscard]] Result<void> setLight(const SkyCelestialLight& light);
105 [[nodiscard]] Result<void> setFrame(const SkyAtmosphereFrame& frame);
108 [[nodiscard]] Result<void> attach();
110 void detach() noexcept;
118 [[nodiscard]] Result<void> prepareView(const glm::mat4& viewProjection, const glm::vec3& eyeMetres);
123 [[nodiscard]] Result<void> draw(const glm::mat4& viewProjection, const glm::vec3& eyeMetres);
124
125private:
126 [[nodiscard]] Result<void> drawView(const glm::mat4&, const glm::vec3&, bool reflection);
128 struct Impl;
129 std::unique_ptr<Impl> impl_;
130};
131} // namespace eve::graphics
#define EVENGINE_API_BACKENDS
Definition Export.h:108
MeshVfxBatchedDraw draw
Move-only, checked operation results for the common layer.
Light3D::Data * light
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Prepared HDR atmospheric sky draw with independent optical parameters and lookup tables.
SkyAtmospherePass(const SkyAtmospherePass &)=delete
SkyAtmospherePass & operator=(const SkyAtmospherePass &)=delete
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
One atomic render snapshot, independent of view count or wall-clock time.
float dayPhase
Injected solar-day fraction in [0,1); zero is midnight, independent of render count.
Spherical atmospheric coefficients in inverse kilometres and kilometre heights.
EVENGINE_API_BACKENDS Result< void > validate() const
Validate finite optical coefficients, bounded geometry and energy controls without mutation.
Explicit celestial lighting snapshot; unit direction points towards the light.
Analytic background height fog in metre units, independent of legacy scene fog.
std::array< float, 3 > directionalInscattering
EVENGINE_API_BACKENDS Result< void > validate() const
Validate finite bounded fog coefficients without mutation.
std::array< float, 2 > directionalElevationRange
Optional directional fog fade over sun direction Y in [-1,1]. Equal endpoints disable fading; otherwi...
Borrowed authored thin-cloud layer, consumed synchronously by sky preparation.