载入中...
搜索中...
未找到
eve::graphics::MapFog类 参考

SLG / large-map war-fog overlay driven by a dual-scrolling cloud texture and an RGBA mask bridge (R unlock, G select, B dissolve). 更多...

#include <MapFog.h>

Public 成员函数

 MapFog (Graphics *graphics)
 Create a fog overlay renderer backed by the supplied graphics device.
 
 ~MapFog ()
 Map fog.
 
 MapFog (const MapFog &)=delete
 
MapFog & operator= (const MapFog &)=delete
 
void update (float dt)
 Advance dual-scroll / blink timers.
 
void setTime (float time)
 Override the animated time used by cloud scroll (seconds).
 
float getTime () const
 Return the current animation time in seconds.
 
void setCloudTexture (Texture *cloud)
 Set or replace the repeating cloud/color texture.
 
Texture * getCloudTexture ()
 Return the active cloud texture (never null after first ensureCloudTexture). @ownership Borrowed; Graphics owns the texture storage. @lifetime Remains valid until Graphics releases the texture or shutdown.
 
void setMaskTexture (Texture *mask)
 Set the RGBA mask bridge texture.
 
Texture * getMaskTexture () const
 Return the current mask texture, or null if unset. @ownership Borrowed; ownership stays with the provider that created the texture. @lifetime Valid until the provider releases the texture or this MapFog is destroyed.
 
void setCloudTiling (float tileA, float tileB)
 Dual-layer cloud tiling (layer A / B).
 
void setCloudSpeed (float speedA, float speedB)
 Dual-layer scroll speeds in UV units per second.
 
void setDistort (float amount)
 Mask-UV distortion amount from desaturated cloud noise.
 
void setDistortFix (float x, float y)
 Correct additive UV drift introduced by distortion.
 
void setFogColor (float r, float g, float b)
 Fog tint RGB in 0..1.
 
void setFogAlpha (float alpha)
 Overall fog opacity in 0..1.
 
void setEdgeSoftness (float softness)
 Soft edge half-width around the mask R threshold.
 
void setShadowEnabled (bool enabled)
 Enable the pre-pass cloud shadow (must draw before the main pass).
 
void setShadow (float offsetX, float offsetY, float strength)
 Shadow UV offset and strength.
 
void setSelectStrength (float strength)
 Selection blink amplitude for mask G.
 
void setDissolveScale (float scale)
 Dissolve noise tiling scale.
 
void setCloudMix (float mix)
 Mix weight between the two scrolling cloud samples (0..1).
 
void setCloudDensity (float contrast, float bias)
 Shape cloud alpha: contrast (soft→hard) and bias (coverage).
 
float getCloudTileA () const
 Returns the cloud tile a.
 
float getCloudTileB () const
 Returns the cloud tile b.
 
float getCloudSpeedA () const
 Returns the cloud speed a.
 
float getCloudSpeedB () const
 Returns the cloud speed b.
 
float getDistort () const
 Returns the distort.
 
float getFogAlpha () const
 Returns the fog alpha.
 
float getEdgeSoftness () const
 Returns the edge softness.
 
bool getShadowEnabled () const
 Returns the shadow enabled.
 
float getSelectStrength () const
 Returns the select strength.
 
void draw (float x, float y, float width, float height)
 Draw fog over a destination rectangle (shadow pass then main pass).
 
Texture * makeCloudTexture (int size=128)
 Build a seamless procedural cloud noise texture owned by Graphics.
 

详细描述

SLG / large-map war-fog overlay driven by a dual-scrolling cloud texture and an RGBA mask bridge (R unlock, G select, B dissolve).

Presentation only: gameplay unlock state should live in map::Fov / game data; upload that state into the mask R channel and call draw() after the map.

在文件 MapFog.h 第 18 行定义.

构造及析构函数说明

◆ MapFog() [1/2]

eve::graphics::MapFog::MapFog ( Graphics *  graphics)
explicit

Create a fog overlay renderer backed by the supplied graphics device.

在文件 MapFog.cpp 第 70 行定义.

引用了 eve::graphics::Shader::declareFloat(), eve::graphics::Graphics::getBackendName(), eve::graphics::Graphics::newShaderFromSpv() , 以及 eve::graphics::Graphics::newShaderFromWgsl().

◆ ~MapFog()

eve::graphics::MapFog::~MapFog ( )
default

Map fog.

◆ MapFog() [2/2]

eve::graphics::MapFog::MapFog ( const MapFog &  )
delete

成员函数说明

◆ draw()

void eve::graphics::MapFog::draw ( float  x,
float  y,
float  width,
float  height 
)

Draw fog over a destination rectangle (shadow pass then main pass).

参数
xDestination left edge.
yDestination top edge.
widthDestination width.
heightDestination height.

在文件 MapFog.cpp 第 516 行定义.

引用了 eve::graphics::Graphics::drawTexturedRectShaderDepth(), height, width, x , 以及 y.

◆ getCloudSpeedA()

float eve::graphics::MapFog::getCloudSpeedA ( ) const
inline

Returns the cloud speed a.

在文件 MapFog.h 第 96 行定义.

◆ getCloudSpeedB()

float eve::graphics::MapFog::getCloudSpeedB ( ) const
inline

Returns the cloud speed b.

在文件 MapFog.h 第 98 行定义.

◆ getCloudTexture()

Texture * eve::graphics::MapFog::getCloudTexture ( )

Return the active cloud texture (never null after first ensureCloudTexture). @ownership Borrowed; Graphics owns the texture storage. @lifetime Remains valid until Graphics releases the texture or shutdown.

在文件 MapFog.cpp 第 310 行定义.

◆ getCloudTileA()

float eve::graphics::MapFog::getCloudTileA ( ) const
inline

Returns the cloud tile a.

在文件 MapFog.h 第 92 行定义.

◆ getCloudTileB()

float eve::graphics::MapFog::getCloudTileB ( ) const
inline

Returns the cloud tile b.

在文件 MapFog.h 第 94 行定义.

◆ getDistort()

float eve::graphics::MapFog::getDistort ( ) const
inline

Returns the distort.

在文件 MapFog.h 第 100 行定义.

◆ getEdgeSoftness()

float eve::graphics::MapFog::getEdgeSoftness ( ) const
inline

Returns the edge softness.

在文件 MapFog.h 第 104 行定义.

◆ getFogAlpha()

float eve::graphics::MapFog::getFogAlpha ( ) const
inline

Returns the fog alpha.

在文件 MapFog.h 第 102 行定义.

◆ getMaskTexture()

Texture * eve::graphics::MapFog::getMaskTexture ( ) const
inline

Return the current mask texture, or null if unset. @ownership Borrowed; ownership stays with the provider that created the texture. @lifetime Valid until the provider releases the texture or this MapFog is destroyed.

在文件 MapFog.h 第 62 行定义.

◆ getSelectStrength()

float eve::graphics::MapFog::getSelectStrength ( ) const
inline

Returns the select strength.

在文件 MapFog.h 第 108 行定义.

◆ getShadowEnabled()

bool eve::graphics::MapFog::getShadowEnabled ( ) const
inline

Returns the shadow enabled.

在文件 MapFog.h 第 106 行定义.

◆ getTime()

float eve::graphics::MapFog::getTime ( ) const
inline

Return the current animation time in seconds.

在文件 MapFog.h 第 34 行定义.

◆ makeCloudTexture()

Texture * eve::graphics::MapFog::makeCloudTexture ( int  size = 128)

Build a seamless procedural cloud noise texture owned by Graphics.

参数
sizeEdge length in pixels (clamped to [16, 512]).
返回
Borrowed Graphics-owned texture, or null on failure. @ownership Graphics owns the returned texture; the caller must not delete it. @lifetime Remains valid until Graphics releases the texture or shutdown.

在文件 MapFog.cpp 第 363 行定义.

引用了 a, b, d, dx, dy, g, h, height, n, eve::graphics::Graphics::newTexture(), nx, ny, nz, p, r, seed, size, t, u, v, x , 以及 y.

◆ operator=()

MapFog & eve::graphics::MapFog::operator= ( const MapFog &  )
delete

◆ setCloudDensity()

void eve::graphics::MapFog::setCloudDensity ( float  contrast,
float  bias 
)

Shape cloud alpha: contrast (soft→hard) and bias (coverage).

在文件 MapFog.cpp 第 358 行定义.

引用了 bias , 以及 contrast.

◆ setCloudMix()

void eve::graphics::MapFog::setCloudMix ( float  mix)

Mix weight between the two scrolling cloud samples (0..1).

在文件 MapFog.cpp 第 356 行定义.

◆ setCloudSpeed()

void eve::graphics::MapFog::setCloudSpeed ( float  speedA,
float  speedB 
)

Dual-layer scroll speeds in UV units per second.

在文件 MapFog.cpp 第 322 行定义.

◆ setCloudTexture()

void eve::graphics::MapFog::setCloudTexture ( Texture *  cloud)

Set or replace the repeating cloud/color texture.

参数
cloudBorrowed Graphics-owned texture; null falls back to a built-in noise cloud. @ownership Does not take ownership of cloud; Graphics retains texture ownership. @lifetime cloud must outlive subsequent draw() calls that use it.

在文件 MapFog.cpp 第 308 行定义.

◆ setCloudTiling()

void eve::graphics::MapFog::setCloudTiling ( float  tileA,
float  tileB 
)

Dual-layer cloud tiling (layer A / B).

在文件 MapFog.cpp 第 317 行定义.

◆ setDissolveScale()

void eve::graphics::MapFog::setDissolveScale ( float  scale)

Dissolve noise tiling scale.

在文件 MapFog.cpp 第 354 行定义.

引用了 scale.

◆ setDistort()

void eve::graphics::MapFog::setDistort ( float  amount)

Mask-UV distortion amount from desaturated cloud noise.

在文件 MapFog.cpp 第 327 行定义.

◆ setDistortFix()

void eve::graphics::MapFog::setDistortFix ( float  x,
float  y 
)

Correct additive UV drift introduced by distortion.

在文件 MapFog.cpp 第 329 行定义.

引用了 x , 以及 y.

◆ setEdgeSoftness()

void eve::graphics::MapFog::setEdgeSoftness ( float  softness)

Soft edge half-width around the mask R threshold.

在文件 MapFog.cpp 第 342 行定义.

◆ setFogAlpha()

void eve::graphics::MapFog::setFogAlpha ( float  alpha)

Overall fog opacity in 0..1.

在文件 MapFog.cpp 第 340 行定义.

◆ setFogColor()

void eve::graphics::MapFog::setFogColor ( float  r,
float  g,
float  b 
)

Fog tint RGB in 0..1.

在文件 MapFog.cpp 第 334 行定义.

引用了 b, g , 以及 r.

◆ setMaskTexture()

void eve::graphics::MapFog::setMaskTexture ( Texture *  mask)

Set the RGBA mask bridge texture.

参数
maskBorrowed texture; R=unlocked, G=selected, B=dissolve threshold. @ownership Does not take ownership of mask; the caller/Graphics retains it. @lifetime mask must outlive subsequent draw() calls that use it.

在文件 MapFog.cpp 第 315 行定义.

引用了 mask.

◆ setSelectStrength()

void eve::graphics::MapFog::setSelectStrength ( float  strength)

Selection blink amplitude for mask G.

在文件 MapFog.cpp 第 352 行定义.

引用了 strength.

◆ setShadow()

void eve::graphics::MapFog::setShadow ( float  offsetX,
float  offsetY,
float  strength 
)

Shadow UV offset and strength.

在文件 MapFog.cpp 第 346 行定义.

引用了 offsetX, offsetY , 以及 strength.

◆ setShadowEnabled()

void eve::graphics::MapFog::setShadowEnabled ( bool  enabled)

Enable the pre-pass cloud shadow (must draw before the main pass).

在文件 MapFog.cpp 第 344 行定义.

引用了 enabled.

◆ setTime()

void eve::graphics::MapFog::setTime ( float  time)

Override the animated time used by cloud scroll (seconds).

在文件 MapFog.cpp 第 306 行定义.

引用了 time.

◆ update()

void eve::graphics::MapFog::update ( float  dt)

Advance dual-scroll / blink timers.

参数
dtSeconds since last frame.

在文件 MapFog.cpp 第 302 行定义.


该类的文档由以下文件生成: