7#include <glm/mat4x4.hpp>
41 void setQuality(
const std::string &quality);
49 void setCamera(
float eyeX,
float eyeY,
float eyeZ,
float targetX,
float targetY,
float targetZ,
50 float upX,
float upY,
float upZ,
float fovYDeg,
float aspect,
float nearZ,
63 depthPyramid_ = atlas;
64 depthPyramidLevels_ = levels;
70 void setRadius(
float radius);
72 void setIntensity(
float intensity);
76 void setResolutionScale(
float scale);
78 void setLightDirection(
float dx,
float dy,
float dz);
80 void setLightColor(
float r,
float g,
float b);
92 bool hasParam(
const std::string &
name)
const;
94 void setFloat(
const std::string &
name,
float value);
96 float getFloat(
const std::string &
name)
const;
99 int getSampleCount()
const;
102 return quality_ ==
"ultra" ? 3 : quality_ ==
"high" ? 2 : quality_ ==
"medium" ? 1 : 0;
119 Canvas *getWorkingCanvas();
133 void applyQualityDefaults();
142 Shader *temporal_ =
nullptr;
143 std::string quality_ =
"medium";
144 glm::mat4 invViewProj_{1.f};
147 float radius_ = 1.25f;
148 float intensity_ = 0.45f;
149 float thickness_ = 0.2f;
150 float temporalCurrentWeight_ = 0.16f;
151 float spatialFilterStrength_ = 0.5f;
152 float resolutionScale_ = 1.f;
153 glm::vec3 lightDir_{0.4f, 1.f, 0.3f};
154 glm::vec3 lightColor_{1.f, 1.f, 1.f};
155 Canvas *giCanvas_ =
nullptr;
156 Texture *worldNormal_ =
nullptr;
158 Texture *temporalMotionDepth_ =
nullptr;
159 Texture *depthPyramid_ =
nullptr;
160 int depthPyramidLevels_ = 0;
161 Canvas *historyA_ =
nullptr;
162 Canvas *historyB_ =
nullptr;
163 Canvas *historyRead_ =
nullptr;
164 Canvas *historyWrite_ =
nullptr;
165 Canvas *spatialA_ =
nullptr;
166 Canvas *spatialB_ =
nullptr;
167 glm::mat4 previousViewProj_{1.f};
168 glm::vec3 previousEye_{0.f};
169 glm::vec3 previousForward_{0.f, 0.f, -1.f};
170 float previousFovY_ = 0.f;
171 float previousAspect_ = 1.f;
172 bool historyValid_ =
false;
173 bool viewProjValid_ =
false;
174 bool cameraValid_ =
false;
175 int historyWidth_ = 0;
176 int historyHeight_ = 0;
177 uint32_t samplingFrame_ = 0;
graphics::Texture * albedo
#define EVENGINE_API_BACKENDS
std::array< float, 3 > scale
const UnitySourceAsset & source
Screen-space single-bounce GI (SSGI). @lifetime All texture arguments are borrowed for the duration o...
float getIntensity() const
Returns the intensity.
void invalidateHistory()
Discard temporal GI history after a render-chain discontinuity.
void setTemporalMotionTexture(Texture *motionDepth)
Set packed linear-depth and motion texture used by temporal GI resolve.
~GlobalIllumination()
Global illumination.
std::string getQuality() const
Returns the quality.
GlobalIllumination & operator=(const GlobalIllumination &)=delete
float getResolutionScale() const
Returns the resolution scale.
GlobalIllumination(const GlobalIllumination &)=delete
float getRadius() const
Returns the radius.
void setDepthPyramid(Texture *atlas, int levels)
Set the shared horizontally packed RG min/max depth hierarchy.
Shader * getShader() const
Returns the shader.
void setWorldNormalTexture(Texture *worldNormal)
Set the GBuffer world-normal texture used for guided GI sampling.
int getSpatialPassCount() const
Number of explicit A-trous prefilter passes for the active quality.
float getThickness() const
Return world-space GI hit thickness.
void setAlbedoTexture(Texture *albedo)
Set receiver albedo used for energy-conserving diffuse GI response.
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...