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 |
◆ count()
| int eve::decal::DecalManager::count | ( | ) | const |
◆ 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.
- 参数
-
gfx Active graphics service. eyeX Camera world-space X coordinate. eyeY Camera world-space Y coordinate. eyeZ Camera world-space Z coordinate. viewProj Camera view-projection matrix. aspect Viewport aspect ratio.
在文件 DecalManager.cpp 第 314 行定义.
引用了 c, d, eve::graphics::Graphics::drawDecal(), eye, frustum , 以及 viewProj.
被这些函数引用 eve::decal::Decal::Decal().
◆ inst()
|
static |
Inst.
在文件 DecalManager.cpp 第 69 行定义.
被这些函数引用 eve::decal::Decal::clearAll(), eve::decal::Decal::count(), eve::decal::Decal::Decal(), eve::decal::Decal::project(), eve::decal::Decal::remove(), eve::decal::Decal::setBlend(), eve::decal::Decal::setEdgeFade(), eve::decal::Decal::setLimit(), eve::decal::Decal::setParallax(), eve::decal::Decal::setProjection(), eve::decal::Decal::setStrength(), eve::decal::Decal::setTextures(), eve::decal::Decal::setUvRect() , 以及 eve::decal::Decal::update().
◆ instances() [1/2]
|
inline |
Instances.
在文件 DecalManager.h 第 153 行定义.
◆ instances() [2/2]
|
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 | ||
| ) |
Atomically install a fully configured instance and remove a previous generation.
- 参数
-
previousId Existing runtime id, or zero for first publication. candidate Complete value; its input id/age are ignored.
- 返回
- New runtime id, or zero when the candidate is invalid.
在文件 DecalManager.cpp 第 249 行定义.
引用了 eve::decal::DecalInstance::age, eve::decal::DecalInstance::blendMode, eve::decal::DecalInstance::blendSharpness, eve::decal::DecalInstance::depth, eve::decal::DecalInstance::edgeFadeWidth, eve::decal::DecalInstance::id, eve::decal::DecalInstance::kind, limit, eve::decal::DecalInstance::nx, eve::decal::DecalInstance::ny, eve::decal::DecalInstance::nz, eve::decal::DecalInstance::parallaxMaxLayers, eve::decal::DecalInstance::parallaxMinLayers, eve::decal::DecalInstance::parallaxScale, previous, eve::decal::DecalInstance::projectionMode , 以及 eve::decal::DecalInstance::size.
◆ setBlend()
| bool eve::decal::DecalManager::setBlend | ( | int | id, |
| const std::string & | mode | ||
| ) |
◆ 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 行定义.
被这些函数引用 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".
- 参数
-
blendSharpness Triplanar |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 | ||
| ) |
◆ setUvRect()
| bool eve::decal::DecalManager::setUvRect | ( | int | id, |
| float | x, | ||
| float | y, | ||
| float | w, | ||
| float | h | ||
| ) |
◆ update()
| void eve::decal::DecalManager::update | ( | float | dt | ) |
Advance instance ages; expire and evict finished decals.
在文件 DecalManager.cpp 第 301 行定义.
被这些函数引用 eve::decal::Decal::update().
该类的文档由以下文件生成:
- src/modules/decal/DecalManager.h
- src/modules/decal/DecalManager.cpp