Skip to content

VitSoonYoung/SpriteStack2D

Repository files navigation

SpriteStack2D

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

SpriteStack2D

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.

About

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

Resources

License

Stars

193 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors