A renderable pseudo-3D sprite stack: a column of layer textures drawn as alpha-blended slices inside the 3D forward pass (call render() after gfx.render3D() / RenderSystem3D::render and before present). 更多...
#include <SpriteStack.h>
类 | |
| struct | SliceDraw |
| One slice instance with its baked world transform and layer UV rect. 更多... | |
Public 成员函数 | |
| SpriteStack3D ()=default | |
| ~SpriteStack3D () | |
| SpriteStack3D (const SpriteStack3D &)=delete | |
| SpriteStack3D & | operator= (const SpriteStack3D &)=delete |
| void | setLayerCount (int count) |
| int | getLayerCount () const |
| void | setLayerTexture (graphics::Texture *texture, int index) |
| Null texture clears the slot (that layer is skipped). | |
| graphics::Texture * | getLayerTexture (int index) const |
| void | setLayerImage (graphics::Graphics *gfx, image::ImageData *img, int index) |
| Upload RGBA8 ImageData layers (convenience around setLayerTexture). | |
| void | setLayerFile (graphics::Graphics *gfx, const std::string &path, int index) |
| Upload each path via Graphics::newTextureFromFile (reloads in place). | |
| void | setLayersFromAtlas (graphics::Graphics *gfx, graphics::Texture *atlas, int layerCount) |
Split one horizontal atlas strip into layerCount layers (layer i = columns [i/count..(i+1)/count)). The strip stays one GPU texture; slices sample their cell through per-layer UV rects. | |
| void | setThickness (float thickness) |
| World-space spacing between consecutive slices. | |
| float | getThickness () const |
| void | setSize (float width, float height) |
| Quad size for every slice (world units). Default 1 x 1. | |
| float | getWidth () const |
| float | getHeight () const |
| void | setPosition (float x, float y, float z) |
| void | setYaw (float radians) |
| void | setTint (float r, float g, float b, float a=1.f) |
| void | setAlphaCutoff (float cutoff) |
| void | setVisible (bool visible) |
| bool | getVisible () const |
| void | setMode (const std::string &mode) |
| std::string | getMode () const |
| void | setShadowEnabled (bool enabled) |
| Pseudo-3D projected contact shadow (soft dark silhouette on the ground). | |
| bool | getShadowEnabled () const |
| void | setShadowOpacity (float opacity) |
| void | setShadowLight (float dx, float dy, float dz) |
| void | setShadowPlaneY (float y) |
| void | setOutline (float width, float r=0.f, float g=0.f, float b=0.f) |
| Stylized rim outline: an expanded dark silhouette behind every slice. | |
| float | getOutlineWidth () const |
| void | setOutlineColor (float r, float g, float b) |
| void | setGbufferEnabled (bool enabled) |
| Contribute this stack to the G-buffer (via RenderSystem3D's extra-drawer hook) so post-processing that reads depth/normal (AO, outline) recognizes the slice silhouettes instead of empty space. | |
| bool | getGbufferEnabled () const |
| void | setCastShadow (bool cast) |
| Cast real CSM shadows: the stack's slices are drawn into the cascaded shadow map through the alpha-cutout shadow pipeline, so the silhouette (not a solid quad) lands on receiving geometry. Requires a directional light with castShadow, or the legacy directional light fallback. | |
| bool | getCastShadow () const |
| uint64_t | getVersion () const |
| Monotonic revision counter; SpriteStackBatch uses it to detect changes. | |
| void | render (graphics::Graphics *gfx, graphics::Camera3D *camera=nullptr) const |
Draw all slices into the currently open 3D scene pass (Vulkan). Uses the active Camera3D when camera is null. Slices are sorted back-to-front and depth-tested against the scene (depth writes stay off). | |
友元 | |
| class | SpriteStackBatch |
详细描述
A renderable pseudo-3D sprite stack: a column of layer textures drawn as alpha-blended slices inside the 3D forward pass (call render() after gfx.render3D() / RenderSystem3D::render and before present).
Modes: "vertical" (default) — bread-slice billboards that always face the camera; yaw rotates the stack's depth layout around Y. "horizontal" — slices are horizontal quads (top-down layers); a 3/4 camera sees true volume with yaw parallax.
Textures are owned by Graphics; this object only holds pointers. Create via eve.SpriteStack().newStack(gfx); the script VM owns the object.
在文件 SpriteStack.h 第 98 行定义.
构造及析构函数说明
◆ SpriteStack3D() [1/2]
|
default |
◆ ~SpriteStack3D()
| eve::spritestack::SpriteStack3D::~SpriteStack3D | ( | ) |
在文件 SpriteStack.cpp 第 782 行定义.
◆ SpriteStack3D() [2/2]
|
delete |
成员函数说明
◆ getCastShadow()
| bool eve::spritestack::SpriteStack3D::getCastShadow | ( | ) | const |
在文件 SpriteStack.cpp 第 780 行定义.
◆ getGbufferEnabled()
| bool eve::spritestack::SpriteStack3D::getGbufferEnabled | ( | ) | const |
在文件 SpriteStack.cpp 第 733 行定义.
◆ getHeight()
| float eve::spritestack::SpriteStack3D::getHeight | ( | ) | const |
在文件 SpriteStack.cpp 第 511 行定义.
◆ getLayerCount()
| int eve::spritestack::SpriteStack3D::getLayerCount | ( | ) | const |
在文件 SpriteStack.cpp 第 454 行定义.
◆ getLayerTexture()
| graphics::Texture * eve::spritestack::SpriteStack3D::getLayerTexture | ( | int | index | ) | const |
在文件 SpriteStack.cpp 第 464 行定义.
◆ getMode()
| std::string eve::spritestack::SpriteStack3D::getMode | ( | ) | const |
在文件 SpriteStack.cpp 第 550 行定义.
◆ getOutlineWidth()
| float eve::spritestack::SpriteStack3D::getOutlineWidth | ( | ) | const |
在文件 SpriteStack.cpp 第 584 行定义.
◆ getShadowEnabled()
| bool eve::spritestack::SpriteStack3D::getShadowEnabled | ( | ) | const |
在文件 SpriteStack.cpp 第 557 行定义.
◆ getThickness()
| float eve::spritestack::SpriteStack3D::getThickness | ( | ) | const |
在文件 SpriteStack.cpp 第 500 行定义.
◆ getVersion()
|
inline |
Monotonic revision counter; SpriteStackBatch uses it to detect changes.
在文件 SpriteStack.h 第 181 行定义.
◆ getVisible()
| bool eve::spritestack::SpriteStack3D::getVisible | ( | ) | const |
在文件 SpriteStack.cpp 第 540 行定义.
◆ getWidth()
| float eve::spritestack::SpriteStack3D::getWidth | ( | ) | const |
在文件 SpriteStack.cpp 第 510 行定义.
◆ operator=()
|
delete |
◆ render()
| void eve::spritestack::SpriteStack3D::render | ( | graphics::Graphics * | gfx, |
| graphics::Camera3D * | camera = nullptr |
||
| ) | const |
Draw all slices into the currently open 3D scene pass (Vulkan). Uses the active Camera3D when camera is null. Slices are sorted back-to-front and depth-tested against the scene (depth writes stay off).
在文件 SpriteStack.cpp 第 791 行定义.
引用了 a, b, eve::graphics::Graphics::drawMeshShader(), eye, fovRad, eve::graphics::Graphics::getHeight(), eve::graphics::Graphics::getWidth(), eve::spritestack::SpriteStack3D::SliceDraw::model, eve::graphics::perspectiveVulkanRH_ZO(), s, eve::graphics::Shader::sendFloat(), eve::graphics::Shader::sendVec4(), eve::graphics::Graphics::setMesh3DCameraPos(), eve::graphics::Graphics::setMesh3DClip(), eve::graphics::Graphics::setMesh3DEnv(), eve::graphics::Graphics::setMesh3DView(), eve::graphics::Graphics::setMesh3DViewProj() , 以及 eve::spritestack::SpriteStack3D::SliceDraw::texture.
◆ setAlphaCutoff()
| void eve::spritestack::SpriteStack3D::setAlphaCutoff | ( | float | cutoff | ) |
在文件 SpriteStack.cpp 第 533 行定义.
◆ setCastShadow()
| void eve::spritestack::SpriteStack3D::setCastShadow | ( | bool | cast | ) |
Cast real CSM shadows: the stack's slices are drawn into the cascaded shadow map through the alpha-cutout shadow pipeline, so the silhouette (not a solid quad) lands on receiving geometry. Requires a directional light with castShadow, or the legacy directional light fallback.
在文件 SpriteStack.cpp 第 771 行定义.
◆ setGbufferEnabled()
| void eve::spritestack::SpriteStack3D::setGbufferEnabled | ( | bool | enabled | ) |
Contribute this stack to the G-buffer (via RenderSystem3D's extra-drawer hook) so post-processing that reads depth/normal (AO, outline) recognizes the slice silhouettes instead of empty space.
在文件 SpriteStack.cpp 第 724 行定义.
引用了 enabled.
◆ setLayerCount()
| void eve::spritestack::SpriteStack3D::setLayerCount | ( | int | count | ) |
在文件 SpriteStack.cpp 第 447 行定义.
被这些函数引用 setLayersFromAtlas().
◆ setLayerFile()
| void eve::spritestack::SpriteStack3D::setLayerFile | ( | graphics::Graphics * | gfx, |
| const std::string & | path, | ||
| int | index | ||
| ) |
Upload each path via Graphics::newTextureFromFile (reloads in place).
在文件 SpriteStack.cpp 第 475 行定义.
引用了 eve::graphics::Graphics::newTextureFromFile() , 以及 setLayerTexture().
◆ setLayerImage()
| void eve::spritestack::SpriteStack3D::setLayerImage | ( | graphics::Graphics * | gfx, |
| image::ImageData * | img, | ||
| int | index | ||
| ) |
Upload RGBA8 ImageData layers (convenience around setLayerTexture).
在文件 SpriteStack.cpp 第 469 行定义.
引用了 eve::graphics::Graphics::newTextureFromImageData() , 以及 setLayerTexture().
◆ setLayersFromAtlas()
| void eve::spritestack::SpriteStack3D::setLayersFromAtlas | ( | graphics::Graphics * | gfx, |
| graphics::Texture * | atlas, | ||
| int | layerCount | ||
| ) |
Split one horizontal atlas strip into layerCount layers (layer i = columns [i/count..(i+1)/count)). The strip stays one GPU texture; slices sample their cell through per-layer UV rects.
在文件 SpriteStack.cpp 第 480 行定义.
引用了 setLayerCount().
◆ setLayerTexture()
| void eve::spritestack::SpriteStack3D::setLayerTexture | ( | graphics::Texture * | texture, |
| int | index | ||
| ) |
Null texture clears the slot (that layer is skipped).
在文件 SpriteStack.cpp 第 456 行定义.
被这些函数引用 setLayerFile() , 以及 setLayerImage().
◆ setMode()
| void eve::spritestack::SpriteStack3D::setMode | ( | const std::string & | mode | ) |
在文件 SpriteStack.cpp 第 542 行定义.
◆ setOutline()
| void eve::spritestack::SpriteStack3D::setOutline | ( | float | width, |
| float | r = 0.f, |
||
| float | g = 0.f, |
||
| float | b = 0.f |
||
| ) |
Stylized rim outline: an expanded dark silhouette behind every slice.
在文件 SpriteStack.cpp 第 576 行定义.
◆ setOutlineColor()
| void eve::spritestack::SpriteStack3D::setOutlineColor | ( | float | r, |
| float | g, | ||
| float | b | ||
| ) |
在文件 SpriteStack.cpp 第 586 行定义.
引用了 b.
◆ setPosition()
| void eve::spritestack::SpriteStack3D::setPosition | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
在文件 SpriteStack.cpp 第 513 行定义.
◆ setShadowEnabled()
| void eve::spritestack::SpriteStack3D::setShadowEnabled | ( | bool | enabled | ) |
Pseudo-3D projected contact shadow (soft dark silhouette on the ground).
在文件 SpriteStack.cpp 第 552 行定义.
引用了 enabled.
◆ setShadowLight()
| void eve::spritestack::SpriteStack3D::setShadowLight | ( | float | dx, |
| float | dy, | ||
| float | dz | ||
| ) |
在文件 SpriteStack.cpp 第 564 行定义.
◆ setShadowOpacity()
| void eve::spritestack::SpriteStack3D::setShadowOpacity | ( | float | opacity | ) |
在文件 SpriteStack.cpp 第 559 行定义.
◆ setShadowPlaneY()
| void eve::spritestack::SpriteStack3D::setShadowPlaneY | ( | float | y | ) |
在文件 SpriteStack.cpp 第 571 行定义.
引用了 y.
◆ setSize()
| void eve::spritestack::SpriteStack3D::setSize | ( | float | width, |
| float | height | ||
| ) |
Quad size for every slice (world units). Default 1 x 1.
在文件 SpriteStack.cpp 第 502 行定义.
◆ setThickness()
| void eve::spritestack::SpriteStack3D::setThickness | ( | float | thickness | ) |
◆ setTint()
| void eve::spritestack::SpriteStack3D::setTint | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float | a = 1.f |
||
| ) |
在文件 SpriteStack.cpp 第 525 行定义.
◆ setVisible()
| void eve::spritestack::SpriteStack3D::setVisible | ( | bool | visible | ) |
在文件 SpriteStack.cpp 第 535 行定义.
◆ setYaw()
| void eve::spritestack::SpriteStack3D::setYaw | ( | float | radians | ) |
在文件 SpriteStack.cpp 第 520 行定义.
友元及相关函数文档
◆ SpriteStackBatch
|
friend |
在文件 SpriteStack.h 第 195 行定义.
该类的文档由以下文件生成:
- src/modules/spritestack/SpriteStack.h
- src/modules/spritestack/SpriteStack.cpp