载入中...
搜索中...
未找到
eve::decal::DecalManager类 参考

CPU-side decal registry: spawn / remove / fade / quotas, and the per-frame drawer that feeds the graphics decal pass. 更多...

#include <DecalManager.h>

Public 成员函数

int project (float x, float y, float z, float nx, float ny, float nz, graphics::Texture *albedo, const std::string &kind, float size, float depth, bool randomYaw, int seed, float fadeIn, float lifetime, float fadeOut, float normalStrength, float roughnessStrength, float metalStrength, float emissiveStrength)
 Spawn a decal at a world-space point facing along (nx,ny,nz).
 
bool remove (int id)
 Removes .
 
bool contains (int id) const
 Whether a projected decal id is still registered.
 
void clearAll ()
 
int count () const
 Returns the number of .
 
bool setStrength (int id, float normalStrength, float roughnessStrength, float metalStrength, float emissiveStrength)
 Sets the strength.
 
bool setUvRect (int id, float x, float y, float w, float h)
 Sets the uv rect.
 
bool setTextures (int id, graphics::Texture *normal, graphics::Texture *params)
 Sets the textures.
 
bool setBlend (int id, const std::string &mode)
 Sets the blend.
 
DecalProjectionStatus setProjection (int id, const std::string &mode, float blendSharpness=4.f)
 Projection mode: "planar" (default) or "triplanar".
 
DecalParallaxStatus setParallax (int id, float scale, float minLayers=8.f, float maxLayers=24.f)
 Configure POM; scale zero disables it and layers satisfy 1 <= min <= max <= 64.
 
DecalEdgeFadeStatus setEdgeFade (int id, float width)
 Configure normalized edge feather width in [0, 0.49].
 
int replace (int previousId, DecalInstance candidate)
 Atomically install a fully configured instance and remove a previous generation.
 
void setLimit (const std::string &kind, int limit)
 Per-kind quota ("blood" -> 64 etc.); oldest of the kind is evicted.
 
void update (float dt)
 Advance instance ages; expire and evict finished decals.
 
void drawAll (graphics::Graphics &gfx, float eyeX, float eyeY, float eyeZ, const glm::mat4 &viewProj, float aspect)
 Draws all live instances into the active graphics decal pass.
 
std::vector< DecalInstance > & instances ()
 Instances.
 
const std::vector< DecalInstance > & instances () const
 Instances.
 

静态 Public 成员函数

static DecalManager & inst ()
 Inst.
 

详细描述

CPU-side decal registry: spawn / remove / fade / quotas, and the per-frame drawer that feeds the graphics decal pass.

Rendering path: DecalManager registers a RenderSystem3D::DecalExtraDrawer, which runs between the G-buffer and the forward pass. For each visible instance it builds the box transform (Z axis = surface normal, optional random yaw) and calls gfx.drawDecal.

在文件 DecalManager.h 第 85 行定义.

成员函数说明

◆ clearAll()

void eve::decal::DecalManager::clearAll ( )

在文件 DecalManager.cpp 第 148 行定义.

被这些函数引用 eve::decal::Decal::clearAll().

◆ contains()

bool eve::decal::DecalManager::contains ( int  id) const

Whether a projected decal id is still registered.

在文件 DecalManager.cpp 第 141 行定义.

引用了 d.

◆ count()

int eve::decal::DecalManager::count ( ) const

Returns the number of .

在文件 DecalManager.cpp 第 150 行定义.

被这些函数引用 eve::decal::Decal::count().

◆ drawAll()

void eve::decal::DecalManager::drawAll ( graphics::Graphics &  gfx,
float  eyeX,
float  eyeY,
float  eyeZ,
const glm::mat4 &  viewProj,
float  aspect 
)

Draws all live instances into the active graphics decal pass.

参数
gfxActive graphics service.
eyeXCamera world-space X coordinate.
eyeYCamera world-space Y coordinate.
eyeZCamera world-space Z coordinate.
viewProjCamera view-projection matrix.
aspectViewport aspect ratio.

在文件 DecalManager.cpp 第 314 行定义.

引用了 c, d, eve::graphics::Graphics::drawDecal(), eye, frustum , 以及 viewProj.

被这些函数引用 eve::decal::Decal::Decal().

◆ inst()

◆ instances() [1/2]

std::vector< DecalInstance > & eve::decal::DecalManager::instances ( )
inline

Instances.

在文件 DecalManager.h 第 153 行定义.

◆ instances() [2/2]

const std::vector< DecalInstance > & eve::decal::DecalManager::instances ( ) const
inline

Instances.

在文件 DecalManager.h 第 155 行定义.

◆ project()

int eve::decal::DecalManager::project ( float  x,
float  y,
float  z,
float  nx,
float  ny,
float  nz,
graphics::Texture *  albedo,
const std::string &  kind,
float  size,
float  depth,
bool  randomYaw,
int  seed,
float  fadeIn,
float  lifetime,
float  fadeOut,
float  normalStrength,
float  roughnessStrength,
float  metalStrength,
float  emissiveStrength 
)

Spawn a decal at a world-space point facing along (nx,ny,nz).

在文件 DecalManager.cpp 第 81 行定义.

引用了 albedo, d, depth, eve::decal::DecalInstance::id, kind, lifetime, limit, normalStrength, nx, ny, nz, seed, size, x, y , 以及 z.

被这些函数引用 eve::decal::Decal::project().

◆ remove()

bool eve::decal::DecalManager::remove ( int  id)

Removes .

在文件 DecalManager.cpp 第 131 行定义.

被这些函数引用 eve::decal_editing::DecalRuntimeBinding::clear() , 以及 eve::decal::Decal::remove().

◆ replace()

int eve::decal::DecalManager::replace ( int  previousId,
DecalInstance  candidate 
)

◆ setBlend()

bool eve::decal::DecalManager::setBlend ( int  id,
const std::string &  mode 
)

Sets the blend.

在文件 DecalManager.cpp 第 187 行定义.

引用了 blend , 以及 d.

被这些函数引用 eve::decal::Decal::setBlend().

◆ setEdgeFade()

DecalEdgeFadeStatus eve::decal::DecalManager::setEdgeFade ( int  id,
float  width 
)

Configure normalized edge feather width in [0, 0.49].

在文件 DecalManager.cpp 第 238 行定义.

引用了 eve::decal::Applied, d, eve::decal::InvalidWidth, eve::decal::UnknownId , 以及 width.

被这些函数引用 eve::decal::Decal::setEdgeFade().

◆ setLimit()

void eve::decal::DecalManager::setLimit ( const std::string &  kind,
int  limit 
)

Per-kind quota ("blood" -> 64 etc.); oldest of the kind is evicted.

在文件 DecalManager.cpp 第 291 行定义.

引用了 kind , 以及 limit.

被这些函数引用 eve::decal::Decal::setLimit().

◆ setParallax()

DecalParallaxStatus eve::decal::DecalManager::setParallax ( int  id,
float  scale,
float  minLayers = 8.f,
float  maxLayers = 24.f 
)

Configure POM; scale zero disables it and layers satisfy 1 <= min <= max <= 64.

在文件 DecalManager.cpp 第 221 行定义.

引用了 eve::decal::Applied, d, eve::decal::InvalidLayers, eve::decal::InvalidScale, scale , 以及 eve::decal::UnknownId.

被这些函数引用 eve::decal::Decal::setParallax().

◆ setProjection()

DecalProjectionStatus eve::decal::DecalManager::setProjection ( int  id,
const std::string &  mode,
float  blendSharpness = 4.f 
)

Projection mode: "planar" (default) or "triplanar".

参数
blendSharpnessTriplanar |n|^exponent; higher = sharper plane seams.
返回
Applied on success; UnknownId / InvalidMode / InvalidSharpness otherwise.

在文件 DecalManager.cpp 第 199 行定义.

引用了 eve::decal::Applied, d, eve::decal::InvalidMode, eve::decal::InvalidSharpness , 以及 eve::decal::UnknownId.

被这些函数引用 eve::decal::Decal::setProjection().

◆ setStrength()

bool eve::decal::DecalManager::setStrength ( int  id,
float  normalStrength,
float  roughnessStrength,
float  metalStrength,
float  emissiveStrength 
)

Sets the strength.

在文件 DecalManager.cpp 第 152 行定义.

引用了 d , 以及 normalStrength.

被这些函数引用 eve::decal::Decal::setStrength().

◆ setTextures()

bool eve::decal::DecalManager::setTextures ( int  id,
graphics::Texture *  normal,
graphics::Texture *  params 
)

Sets the textures.

在文件 DecalManager.cpp 第 177 行定义.

引用了 d, normal , 以及 params.

被这些函数引用 eve::decal::Decal::setTextures().

◆ setUvRect()

bool eve::decal::DecalManager::setUvRect ( int  id,
float  x,
float  y,
float  w,
float  h 
)

Sets the uv rect.

在文件 DecalManager.cpp 第 165 行定义.

引用了 d, h, w, x , 以及 y.

被这些函数引用 eve::decal::Decal::setUvRect().

◆ update()

void eve::decal::DecalManager::update ( float  dt)

Advance instance ages; expire and evict finished decals.

在文件 DecalManager.cpp 第 301 行定义.

被这些函数引用 eve::decal::Decal::update().


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