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

Runtime decal module — project surface effects (blood, dirt, scorch, dents via normal maps, ...) onto any world geometry. 更多...

#include <Decal.h>

类 eve::decal::Decal 继承关系图:
eve::Module

类

struct  ProceduralBakeCache
 

Public 成员函数

 Module_REG (Decal)
 
 Decal ()
 Decal.
 
 ~Decal () override
 Decal.
 
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)
 Spawn a decal at (x,y,z) facing along (nx,ny,nz); returns id.
 
bool setStrength (int id, float normalStrength, float roughnessStrength, float metalStrength, float emissiveStrength)
 Per-channel blend strengths for a live decal (0 disables).
 
bool setUvRect (int id, float x, float y, float w, float h)
 Atlas region [x, y, w, h] (normalized) for a live decal.
 
bool setTextures (int id, graphics::Texture *normal, graphics::Texture *params)
 Optional normal / params (roughness, metallic, emissive) textures.
 
bool setBlend (int id, const std::string &mode)
 Blend mode: "over" (default) or "add" (emissive).
 
DecalProjectionStatus setProjection (int id, const std::string &mode, float blendSharpness)
 Projection: "planar", "triplanar", "spherical", or world-aligned "world".
 
DecalParallaxStatus setParallax (int id, float scale, float minLayers, float maxLayers)
 Configure params-alpha POM; scale zero disables it.
 
DecalEdgeFadeStatus setEdgeFade (int id, float width)
 Configure normalized edge-mask feather width in [0, 0.49].
 
bool remove (int id)
 Removes .
 
void clearAll ()
 Clears all.
 
int count ()
 Returns the number of .
 
void setLimit (const std::string &kind, int limit)
 Sets the limit.
 
void update (float dt)
 Advance ages / evict expired; call once per frame.
 
void setEnabled (graphics::Graphics *gfx, bool enabled)
 Toggle the graphics "decal" feature on the given backend.
 
std::string proceduralPresets () const
 Return the stable comma-separated Procedural Decal preset names.
 
graphics::Texture * bakePresetTexture (graphics::Graphics *gfx, const std::string &preset, std::uint32_t seed, int resolution, const std::string &channel)
 Bake one channel of a named Procedural Decal preset and upload it.
 
graphics::Texture * bakeSbsprsTexture (graphics::Graphics *gfx, const std::string &xml, int resolution, const std::string &channel)
 Import a Procedural Decal .sbsprs document, bake it, and upload one channel.
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 Module.
 
virtual std::string getName () const =0
 Returns the name.
 

详细描述

Runtime decal module — project surface effects (blood, dirt, scorch, dents via normal maps, ...) onto any world geometry.

Script: decal <- eve.Decal();

Rendering: screen-space box-projected decals. The module registers a RenderSystem3D decal drawer; the "decal" RenderControl feature gates the pass (see setEnabled). decal.update(dt) must be called each frame to advance fades and evict expired instances.

在文件 Decal.h 第 29 行定义.

构造及析构函数说明

◆ Decal()

◆ ~Decal()

eve::decal::Decal::~Decal ( )
override

Decal.

在文件 Decal.cpp 第 47 行定义.

引用了 eve::decal::unregisterDecalAttackVfxExecutor().

成员函数说明

◆ bakePresetTexture()

graphics::Texture * eve::decal::Decal::bakePresetTexture ( graphics::Graphics *  gfx,
const std::string &  preset,
std::uint32_t  seed,
int  resolution,
const std::string &  channel 
)

Bake one channel of a named Procedural Decal preset and upload it.

参数
gfxGraphics service that owns the returned texture.
presetPreset listed by proceduralPresets().
seedDeterministic authoring seed.
resolutionSquare output size in the inclusive range 1..4096.
channelOne of "albedo", "normal", or "params".
返回
Borrowed texture owned by gfx; it remains valid according to the graphics resource lifetime. @cost The first unique preset/seed/resolution request is linear in pixel count and blur radius; adjacent channel requests reuse one bounded CPU bake result. Bake during load or authoring.
异常
eve::Exceptionwhen arguments or the recipe are invalid. @thread Must run on the graphics service's resource-creation thread. @reentrancy Does not invoke scripts or callbacks.

在文件 Decal.cpp 第 113 行定义.

引用了 eve::decal::bakeProceduralDecal(), bytes, eve::graphics::Graphics::newTexture(), eve::decal::proceduralDecalPreset(), seed , 以及 source.

◆ bakeSbsprsTexture()

graphics::Texture * eve::decal::Decal::bakeSbsprsTexture ( graphics::Graphics *  gfx,
const std::string &  xml,
int  resolution,
const std::string &  channel 
)

Import a Procedural Decal .sbsprs document, bake it, and upload one channel.

参数
gfxGraphics service that owns the returned texture.
xmlUTF-8 Substance preset document.
resolutionSquare output size in the inclusive range 1..4096.
channelOne of "albedo", "normal", or "params".
返回
Borrowed texture owned by gfx. @cost The first unique document/resolution request is linear in XML size, pixel count, and blur radius; adjacent channel requests reuse one bounded CPU bake result. Admission/loading only.
异常
eve::Exceptionwhen import, bake, channel selection, or upload fails. @thread Must run on the graphics service's resource-creation thread. @reentrancy Does not invoke scripts or callbacks.

在文件 Decal.cpp 第 138 行定义.

引用了 eve::decal::bakeProceduralDecal(), bytes, eve::decal::importProceduralDecalSbsprs(), eve::graphics::Graphics::newTexture() , 以及 source.

◆ clearAll()

void eve::decal::Decal::clearAll ( )

Clears all.

在文件 Decal.cpp 第 89 行定义.

引用了 eve::decal::DecalManager::clearAll() , 以及 eve::decal::DecalManager::inst().

◆ count()

int eve::decal::Decal::count ( )

Returns the number of .

在文件 Decal.cpp 第 91 行定义.

引用了 eve::decal::DecalManager::count() , 以及 eve::decal::DecalManager::inst().

◆ Module_REG()

eve::decal::Decal::Module_REG ( Decal  )

◆ proceduralPresets()

std::string eve::decal::Decal::proceduralPresets ( ) const

Return the stable comma-separated Procedural Decal preset names.

返回
Value-owned UTF-8 text suitable for UI menus and EveScript discovery.

在文件 Decal.cpp 第 109 行定义.

◆ project()

int eve::decal::Decal::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 
)

Spawn a decal at (x,y,z) facing along (nx,ny,nz); returns id.

在文件 Decal.cpp 第 49 行定义.

引用了 albedo, depth, eve::decal::DecalManager::inst(), kind, lifetime, nx, ny, nz, eve::decal::DecalManager::project(), seed, size, x, y , 以及 z.

◆ remove()

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

Removes .

在文件 Decal.cpp 第 87 行定义.

引用了 eve::decal::DecalManager::inst() , 以及 eve::decal::DecalManager::remove().

◆ setBlend()

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

Blend mode: "over" (default) or "add" (emissive).

在文件 Decal.cpp 第 71 行定义.

引用了 eve::decal::DecalManager::inst() , 以及 eve::decal::DecalManager::setBlend().

◆ setEdgeFade()

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

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

在文件 Decal.cpp 第 83 行定义.

引用了 eve::decal::DecalManager::inst(), eve::decal::DecalManager::setEdgeFade() , 以及 width.

◆ setEnabled()

void eve::decal::Decal::setEnabled ( graphics::Graphics *  gfx,
bool  enabled 
)

Toggle the graphics "decal" feature on the given backend.

在文件 Decal.cpp 第 99 行定义.

引用了 enabled , 以及 eve::graphics::Graphics::getRenderControl().

◆ setLimit()

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

Sets the limit.

在文件 Decal.cpp 第 93 行定义.

引用了 eve::decal::DecalManager::inst(), kind, limit , 以及 eve::decal::DecalManager::setLimit().

◆ setParallax()

DecalParallaxStatus eve::decal::Decal::setParallax ( int  id,
float  scale,
float  minLayers,
float  maxLayers 
)

Configure params-alpha POM; scale zero disables it.

在文件 Decal.cpp 第 79 行定义.

引用了 eve::decal::DecalManager::inst(), scale , 以及 eve::decal::DecalManager::setParallax().

◆ setProjection()

DecalProjectionStatus eve::decal::Decal::setProjection ( int  id,
const std::string &  mode,
float  blendSharpness 
)

Projection: "planar", "triplanar", "spherical", or world-aligned "world".

参数
blendSharpnessTriplanar blend exponent (typical 2–10; default 4).
返回
DecalProjectionStatus::Applied on success.

在文件 Decal.cpp 第 75 行定义.

引用了 eve::decal::DecalManager::inst() , 以及 eve::decal::DecalManager::setProjection().

◆ setStrength()

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

Per-channel blend strengths for a live decal (0 disables).

在文件 Decal.cpp 第 57 行定义.

引用了 eve::decal::DecalManager::inst(), normalStrength , 以及 eve::decal::DecalManager::setStrength().

◆ setTextures()

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

Optional normal / params (roughness, metallic, emissive) textures.

在文件 Decal.cpp 第 67 行定义.

引用了 eve::decal::DecalManager::inst(), normal, params , 以及 eve::decal::DecalManager::setTextures().

◆ setUvRect()

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

Atlas region [x, y, w, h] (normalized) for a live decal.

在文件 Decal.cpp 第 63 行定义.

引用了 h, eve::decal::DecalManager::inst(), eve::decal::DecalManager::setUvRect(), w, x , 以及 y.

◆ update()

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

Advance ages / evict expired; call once per frame.

在文件 Decal.cpp 第 97 行定义.

引用了 eve::decal::DecalManager::inst() , 以及 eve::decal::DecalManager::update().


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