SpriteStack2D 是一个 Godot 4 插件,可以从单个 2x2 正交像素艺术视图图集渲染伪 3D 精灵堆叠。

Stars

212

7 天增长

暂无数据

Fork 数

5

开放 Issue

0

开源协议

MIT

最近更新

2026-07-16

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它通过共享缓存(输出图像和输入数据)实现高性能(1000 个旋转对象约 160 FPS),并采用引用计数,在不再使用时自动释放。

适合谁使用

  • Godot 4 游戏开发者
  • 创建具有 3D 旋转效果的 2D 像素艺术资产的艺术家
  • 追求轻量级类 3D 视觉的独立开发者

典型使用场景

  • 在 2D 游戏中创建旋转的像素艺术物品
  • 无需 3D 建模即可为精灵添加伪 3D 效果
  • 以最小开销渲染大量相同对象的群组

项目优势

  • 高效缓存:相同输入和参数的所有实例共享输出图像
  • 简单设置:只需一个 2x2 图集和一个节点分配
  • MIT 许可证允许无限制使用和修改

使用前须知

  • 仅适用于 Godot 4.x(不兼容 Godot 3)
  • 仅支持 2x2 精灵表格格式,未说明自定义布局
  • 伪 3D 渲染对于复杂形状可能无法达到真实 3D 质量

README 快速开始

SpriteStack2D

A Godot 4 node that renders pseudo 3D sprite stacks from a single sheet of pixel-art face views.

Setup

  1. Draw a 2x2 spritesheet of orthographic views (all frames the same size): frame 1 = TOP, 2 = FRONT, 3 = SIDE, 4 = BACK (leave the 4th frame empty to mirror the front).
  2. Download, extract to your Godot project at res://addons/..., and enable the addon.
  3. Add a SpriteStack2D node and assign the sheet to texture, the grid is applied automatically from source_mode (4 Faces = 2x2).

Performance

What gets rendered is the final output image per angle (rotation, stack, shadow composited) frames live in a cache shared by all SpriteStack2D instances with the same input and parameters, so a thousand identical nodes render each angle once in total (≈160 FPS for 1.000 spinning objects).

The prepared input (cut frames, carved slices) is likewise shared per input texture, and both caches are reference-counted: when the last node using an input is freed, its cached data is purged.

res://test/perf_test.tscn is a stress-test scene with live stats. Tested on Godot 4.7.

License

MIT.

项目描述

Render pseudo 3D sprite node from a single 2D texture of different view angles

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

callmemhz
callmemhz GitHub avatar

godot-map-builder

A brush-based level editor plugin for Godot 4 that lets you create and edit 3D maps directly in the editor viewport, inspired by TrenchBroom.

GDScript
33