载入中...
搜索中...
未找到
Decal.cpp
浏览该文件的文档.
57bool Decal::setStrength(int id, float normalStrength, float roughnessStrength, float metalStrength,
75DecalProjectionStatus Decal::setProjection(int id, const std::string &mode, float blendSharpness) {
bool setUvRect(int id, float x, float y, float w, float h)
Sets the uv rect.
Definition DecalManager.cpp:165
bool setTextures(int id, graphics::Texture *normal, graphics::Texture *params)
Sets the textures.
Definition DecalManager.cpp:177
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.
Definition DecalManager.cpp:314
bool setStrength(int id, float normalStrength, float roughnessStrength, float metalStrength, float emissiveStrength)
Sets the strength.
Definition DecalManager.cpp:152
DecalProjectionStatus setProjection(int id, const std::string &mode, float blendSharpness=4.f)
Projection mode: "planar" (default) or "triplanar".
Definition DecalManager.cpp:199
DecalEdgeFadeStatus setEdgeFade(int id, float width)
Configure normalized edge feather width in [0, 0.49].
Definition DecalManager.cpp:238
void setLimit(const std::string &kind, int limit)
Per-kind quota ("blood" -> 64 etc.); oldest of the kind is evicted.
Definition DecalManager.cpp:291
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.
Definition DecalManager.cpp:221
void update(float dt)
Advance instance ages; expire and evict finished decals.
Definition DecalManager.cpp:301
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).
Definition DecalManager.cpp:81
Runtime decal module — project surface effects (blood, dirt, scorch, dents via normal maps,...
Definition Decal.h:29
DecalProjectionStatus setProjection(int id, const std::string &mode, float blendSharpness)
Projection: "planar", "triplanar", "spherical", or world-aligned "world".
Definition Decal.cpp:75
DecalEdgeFadeStatus setEdgeFade(int id, float width)
Configure normalized edge-mask feather width in [0, 0.49].
Definition Decal.cpp:83
bool setStrength(int id, float normalStrength, float roughnessStrength, float metalStrength, float emissiveStrength)
Per-channel blend strengths for a live decal (0 disables).
Definition Decal.cpp:57
bool setTextures(int id, graphics::Texture *normal, graphics::Texture *params)
Optional normal / params (roughness, metallic, emissive) textures.
Definition Decal.cpp:67
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.
Definition Decal.cpp:49
DecalParallaxStatus setParallax(int id, float scale, float minLayers, float maxLayers)
Configure params-alpha POM; scale zero disables it.
Definition Decal.cpp:79
void setEnabled(graphics::Graphics *gfx, bool enabled)
Toggle the graphics "decal" feature on the given backend.
Definition Decal.cpp:99
bool setBlend(int id, const std::string &mode)
Blend mode: "over" (default) or "add" (emissive).
Definition Decal.cpp:71
bool setUvRect(int id, float x, float y, float w, float h)
Atlas region [x, y, w, h] (normalized) for a live decal.
Definition Decal.cpp:63
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.
Definition Decal.cpp:138
std::string proceduralPresets() const
Return the stable comma-separated Procedural Decal preset names.
Definition Decal.cpp:109
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.
Definition Decal.cpp:113
Definition Graphics.h:125
virtual Texture * newTexture(int width, int height, const uint8_t *rgba, bool repeatU=false, bool repeatV=false)=0
Creates a texture. @ownership Caller deletes unless documented otherwise.
RenderControl * getRenderControl()
Shared compilable 3D render control (features → pass list + GBuffer). Owned by Graphics; valid for th...
Definition Graphics.cpp:254
static void addDecalExtraDrawer(DecalExtraDrawer drawer)
Adds decal extra drawer.
Definition RenderSystem3D.cpp:540
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
Definition Decal.cpp:12
DecalParallaxStatus
Outcome of applying height-driven parallax settings to a live decal.
Definition DecalManager.h:62
void unregisterDecalAttackVfxExecutor()
Unregister the AttackVfx Decal layer executor.
Definition DecalAttackVfx.cpp:189
void registerDecalCapabilities()
Register the IDecalQuery capability (implemented in DecalCapabilities.cpp).
Definition DecalCapabilities.cpp:36
Result< ProceduralDecalBake > bakeProceduralDecal(const ProceduralDecalRecipe &recipe)
Bake a two-layer decal recipe into renderer-ready texture bytes.
Definition ProceduralDecal.cpp:436
Result< ProceduralDecalRecipe > proceduralDecalPreset(std::string_view name, std::uint32_t seed)
Build a deterministic preset recipe.
Definition ProceduralDecal.cpp:295
DecalProjectionStatus
Outcome of DecalManager::setProjection / Decal::setProjection.
Definition DecalManager.h:54
Result< ProceduralDecalRecipe > importProceduralDecalSbsprs(std::string_view xml)
Import one Substance .sbsprs preset into the native version-two recipe.
Definition ProceduralDecal.cpp:336
DecalEdgeFadeStatus
Outcome of changing the projection-volume edge mask width.
Definition DecalManager.h:70
Definition Container.h:602
Owning, renderer-neutral output of one decal bake.
Definition ProceduralDecal.h:80
std::vector< std::uint8_t > albedo
Definition ProceduralDecal.h:83
std::vector< std::uint8_t > params
Definition ProceduralDecal.h:85
std::vector< std::uint8_t > normal
Definition ProceduralDecal.h:84