11#include <glm/mat4x4.hpp>
12#include <glm/vec3.hpp>
49 void setQuality(
const std::string &quality);
54 void setMode(
const std::string &mode);
56 std::string
getMode()
const {
return mode_; }
59 void setLightScreenUV(
float u,
float v);
61 float getLightScreenU()
const;
63 float getLightScreenV()
const;
66 void setLightScreenPos(
float x,
float y,
float width,
float height);
69 void setLightDirection(
float dx,
float dy,
float dz);
75 void setCamera(
float eyeX,
float eyeY,
float eyeZ,
float targetX,
float targetY,
float targetZ,
76 float upX,
float upY,
float upZ,
float fovYDeg,
float aspect,
float nearZ,
83 void setShaftColor(
float r,
float g,
float b);
85 void setFogColor(
float r,
float g,
float b);
87 void setIntensity(
float intensity);
89 void setTime(
float seconds);
91 void setDensity(
float density);
97 void setAnisotropy(
float g);
99 float getAnisotropy()
const;
102 void setFogHeight(
float worldY);
104 void setFogHeightFalloff(
float falloff);
106 void setFogStart(
float startDistance);
108 void setFogEnd(
float endDistance);
110 void setFogNoise(
float amount);
113 void setCloudLayer(
float bottom,
float top);
115 void setCloudCoverage(
float coverage);
117 void setCloudDensity(
float density);
119 void setCloudScale(
float worldScale);
121 void setCloudWind(
float x,
float z);
123 void setCloudLightColor(
float r,
float g,
float b);
126 bool hasParam(
const std::string &
name)
const;
128 void setFloat(
const std::string &
name,
float value);
130 float getFloat(
const std::string &
name)
const;
133 int getSampleCount()
const;
141 void beginOcclusionMap(
Graphics *gfx,
float lightPixelX,
float lightPixelY,
142 float lightRadiusPixels = 24.f);
145 void drawOccluder(
Graphics *gfx,
Drawable *drawable,
const glm::mat4 &matrix);
148 void drawOccluderSolid(
Graphics *gfx,
float x,
float y,
float w,
float h);
150 void drawOccluderTexture(
Graphics *gfx,
Texture *texture,
float x,
float y,
float w,
float h);
198 Texture *cookie,
float worldSize,
199 float intensity = 1.f);
210 void configureFroxelGrid(
int width,
int height,
int depth,
float nearDistance,
217 void clearFroxelGrid();
219 void injectFroxelHeightFog(
float extinction,
float albedoR,
float albedoG,
float albedoB,
220 float baseHeight,
float heightFalloff,
float minWorldY,
225 void integrateFroxel(
float lightR,
float lightG,
float lightB,
float phaseScale = 1.f);
234 [[nodiscard]]
Result<int> collectSceneLights3D(std::vector<VolumetricLight> &out,
252 [[nodiscard]]
Result<void> driveFromPrimarySceneLight3D(
float viewportW,
float viewportH);
262 const glm::vec3 &worldMin,
263 const glm::vec3 &worldMax,
273 Canvas *canvasFilter =
nullptr,
274 float defaultRadiusPixels = 24.f);
285 Canvas *canvasFilter =
nullptr);
291 [[nodiscard]]
Result<void> injectEmissiveLightProxy(
float x,
float y,
float z,
float r,
float g,
292 float b,
float radius,
float intensity);
307 float (*depth01)(
int x,
int y,
void *userdata),
void *userdata);
314 int resolutionFor(
int fullSize)
const;
320 void drawOccluders2D(
Graphics *gfx);
336 void applyQualityDefaults();
337 void uploadCommon(
bool compositeFromScene);
338 void uploadRayMarchCommon();
339 void uploadFogCommon();
340 void uploadCloudCommon();
342 void uploadRayMarchShadowAnisotropy();
343 void clearPendingEmissiveProxies();
346 Shader *shader_ =
nullptr;
347 Shader *rayShader_ =
nullptr;
348 Shader *fogShader_ =
nullptr;
349 Shader *directionalCookieShader_ =
nullptr;
350 Shader *cloudShader_ =
nullptr;
351 Shader *froxelShader_ =
nullptr;
352 std::unique_ptr<AtmosphereVolume> atmosphereVolume_;
353 Texture *froxelAtlas_ =
nullptr;
354 int froxelAtlasCols_ = 1;
355 int froxelAtlasRows_ = 1;
356 std::string quality_ =
"medium";
357 std::string mode_ =
"screenspace";
358 float downscale_ = 2.f;
359 glm::mat4 invViewProj_{1.f};
362 glm::vec3 lightDir_{0.4f, 1.f, 0.3f};
363 float anisotropy_ = 0.6f;
364 float fogHeight_ = 0.f;
365 float fogHeightFalloff_ = 0.15f;
366 float fogStart_ = 2.f;
367 float fogEnd_ = 40.f;
368 float fogNoise_ = 0.35f;
369 float cloudBottom_ = 8.f;
370 float cloudTop_ = 16.f;
371 float cloudCoverage_ = 0.55f;
372 float cloudDensity_ = 1.f;
373 float cloudScale_ = 18.f;
374 glm::vec3 cloudWind_{1.5f, 0.f, 0.4f};
375 glm::vec3 cloudLightColor_{1.f, 0.92f, 0.78f};
376 std::vector<VolumetricLight> pendingEmissiveProxies_;
#define EVENGINE_API_BACKENDS
std::weak_ptr< PrimitiveScene > scene
Move-only, checked operation results for the common layer.
const UnitySourceAsset & source
Move-only operation result carrying either a value or Status.
Camera-frustum volume used by the volumetric fog passes and CPU references.
Drawable base (textures, meshes, canvases).
Analytic local participating-media volume injected into atmospheric fog.
Declarative 3D light. Collected by RenderSystem3D (max 8 per frame). type: "point" | "dir" | "spot" (...
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Volumetric & operator=(const Volumetric &)=delete
Shader * getCloudShader() const
Returns the cloud shader.
Volumetric(const Volumetric &)=delete
float getDownscale() const
Returns the downscale.
Shader * getShader() const
Returns the shader.
std::string getMode() const
Returns the mode.
std::string getQuality() const
Returns the quality.
const glm::mat4 & getInvViewProj() const
Inverse view-projection last written by setCamera / setInvViewProj.
Shader * getFroxelShader() const
Returns the froxel shader.
AtmosphereVolume * getAtmosphereVolume() const
Access the froxel media grid for native density/light injection.
Shader * getRayMarchShader() const
Returns the ray march shader.
Texture * getFroxelAtlas() const
Returns the froxel atlas.
Shader * getFogShader() const
Returns the fog shader.
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...