载入中...
搜索中...
未找到
eve::spritestack::SpriteStack3D类 参考

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
 
SpriteStack3Doperator= (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::TexturegetLayerTexture (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.h98 行定义.

构造及析构函数说明

◆ SpriteStack3D() [1/2]

eve::spritestack::SpriteStack3D::SpriteStack3D ( )
default

◆ ~SpriteStack3D()

eve::spritestack::SpriteStack3D::~SpriteStack3D ( )

在文件 SpriteStack.cpp782 行定义.

◆ SpriteStack3D() [2/2]

eve::spritestack::SpriteStack3D::SpriteStack3D ( const SpriteStack3D )
delete

成员函数说明

◆ getCastShadow()

bool eve::spritestack::SpriteStack3D::getCastShadow ( ) const

在文件 SpriteStack.cpp780 行定义.

◆ getGbufferEnabled()

bool eve::spritestack::SpriteStack3D::getGbufferEnabled ( ) const

在文件 SpriteStack.cpp733 行定义.

◆ getHeight()

float eve::spritestack::SpriteStack3D::getHeight ( ) const

在文件 SpriteStack.cpp511 行定义.

◆ getLayerCount()

int eve::spritestack::SpriteStack3D::getLayerCount ( ) const

在文件 SpriteStack.cpp454 行定义.

◆ getLayerTexture()

graphics::Texture * eve::spritestack::SpriteStack3D::getLayerTexture ( int  index) const

在文件 SpriteStack.cpp464 行定义.

◆ getMode()

std::string eve::spritestack::SpriteStack3D::getMode ( ) const

在文件 SpriteStack.cpp550 行定义.

◆ getOutlineWidth()

float eve::spritestack::SpriteStack3D::getOutlineWidth ( ) const

在文件 SpriteStack.cpp584 行定义.

◆ getShadowEnabled()

bool eve::spritestack::SpriteStack3D::getShadowEnabled ( ) const

在文件 SpriteStack.cpp557 行定义.

◆ getThickness()

float eve::spritestack::SpriteStack3D::getThickness ( ) const

在文件 SpriteStack.cpp500 行定义.

◆ getVersion()

uint64_t eve::spritestack::SpriteStack3D::getVersion ( ) const
inline

Monotonic revision counter; SpriteStackBatch uses it to detect changes.

在文件 SpriteStack.h181 行定义.

◆ getVisible()

bool eve::spritestack::SpriteStack3D::getVisible ( ) const

在文件 SpriteStack.cpp540 行定义.

◆ getWidth()

float eve::spritestack::SpriteStack3D::getWidth ( ) const

在文件 SpriteStack.cpp510 行定义.

◆ operator=()

SpriteStack3D & eve::spritestack::SpriteStack3D::operator= ( const SpriteStack3D )
delete

◆ render()

◆ setAlphaCutoff()

void eve::spritestack::SpriteStack3D::setAlphaCutoff ( float  cutoff)

在文件 SpriteStack.cpp533 行定义.

◆ 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.cpp771 行定义.

◆ 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.cpp724 行定义.

引用了 enabled.

◆ setLayerCount()

void eve::spritestack::SpriteStack3D::setLayerCount ( int  count)

在文件 SpriteStack.cpp447 行定义.

被这些函数引用 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.cpp475 行定义.

引用了 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.cpp469 行定义.

引用了 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.cpp480 行定义.

引用了 setLayerCount().

◆ setLayerTexture()

void eve::spritestack::SpriteStack3D::setLayerTexture ( graphics::Texture texture,
int  index 
)

Null texture clears the slot (that layer is skipped).

在文件 SpriteStack.cpp456 行定义.

被这些函数引用 setLayerFile() , 以及 setLayerImage().

◆ setMode()

void eve::spritestack::SpriteStack3D::setMode ( const std::string &  mode)

在文件 SpriteStack.cpp542 行定义.

◆ 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.cpp576 行定义.

引用了 b , 以及 width.

◆ setOutlineColor()

void eve::spritestack::SpriteStack3D::setOutlineColor ( float  r,
float  g,
float  b 
)

在文件 SpriteStack.cpp586 行定义.

引用了 b.

◆ setPosition()

void eve::spritestack::SpriteStack3D::setPosition ( float  x,
float  y,
float  z 
)

在文件 SpriteStack.cpp513 行定义.

引用了 x, y , 以及 z.

◆ setShadowEnabled()

void eve::spritestack::SpriteStack3D::setShadowEnabled ( bool  enabled)

Pseudo-3D projected contact shadow (soft dark silhouette on the ground).

在文件 SpriteStack.cpp552 行定义.

引用了 enabled.

◆ setShadowLight()

void eve::spritestack::SpriteStack3D::setShadowLight ( float  dx,
float  dy,
float  dz 
)

在文件 SpriteStack.cpp564 行定义.

◆ setShadowOpacity()

void eve::spritestack::SpriteStack3D::setShadowOpacity ( float  opacity)

在文件 SpriteStack.cpp559 行定义.

◆ setShadowPlaneY()

void eve::spritestack::SpriteStack3D::setShadowPlaneY ( float  y)

在文件 SpriteStack.cpp571 行定义.

引用了 y.

◆ setSize()

void eve::spritestack::SpriteStack3D::setSize ( float  width,
float  height 
)

Quad size for every slice (world units). Default 1 x 1.

在文件 SpriteStack.cpp502 行定义.

引用了 height , 以及 width.

◆ setThickness()

void eve::spritestack::SpriteStack3D::setThickness ( float  thickness)

World-space spacing between consecutive slices.

在文件 SpriteStack.cpp494 行定义.

引用了 thickness.

◆ setTint()

void eve::spritestack::SpriteStack3D::setTint ( float  r,
float  g,
float  b,
float  a = 1.f 
)

在文件 SpriteStack.cpp525 行定义.

引用了 a , 以及 b.

◆ setVisible()

void eve::spritestack::SpriteStack3D::setVisible ( bool  visible)

在文件 SpriteStack.cpp535 行定义.

◆ setYaw()

void eve::spritestack::SpriteStack3D::setYaw ( float  radians)

在文件 SpriteStack.cpp520 行定义.

友元及相关函数文档

◆ SpriteStackBatch

friend class SpriteStackBatch
friend

在文件 SpriteStack.h195 行定义.


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