Construct 3 SpriteStack effect
A downloadable project
This is a port to Construct 3 of the excellent shader from @Securas2010 (many thanks for the permission to share it with the C3 community.)
It's a work in progress, but fun to play with. It's an alternative to using multiple sprites and Z elevation in C3. This is a collab with hcatarrunas from Construct Discord who was helped a lot with the sample project, shader edits, good settings for the shader and suggesting good changes to the C3 shader / addon.
Performance is fairly GPU heavy, so as per usual do some performance testing before commiting to a project using this shader.
Smaller voxel objects seem to work pretty well, large or tall voxel objects are a little more difficult to work with, but can be done. There is a sample C3 project included with some sample voxel characters rendered with the SpriteStack shader.
Exporting and Importing from Magica Voxel
- Constraints on Magica Voxel Models: the _base_ of the Model volume must be a square (width and depth must be the same.) Below is a diagram from hcatarrunas that shows this.
- Export from Magica Voxel using the 'slice' export option.
- The output file is renamed to end with the *.png extension and then loaded as a texture into a C3 sprite.
- It should be a very long and narrow image.
- Add the SpriteStack effect to the sprite.
- When placed on the layout change the Sprite size to double the size of the final object. Ex. to have an object 32x32 px in game make the object 64x64 px on the layout and apply the effect.
See the example project on how to handle things like angle. One way to handle animations like this is to have a separate 'player' or 'enemy' sprite that you apply behaviors, collision, physics to and then pin/child/parent the Sprite w/ the SpriteStack effect on it too, this allows you to control collision box, physics, etc. separate from the SpriteStack rendered Sprite.
SliceHeight is an interesting parameter, it's a tradeoff between rendering quality of the voxels vs performance. The smaller the slice, the more is rendered between slices at higher performance cost (use debug mode to check impact on GPU performance.)
In order to download this project you must purchase it at or above the minimum price of $2 USD. You will get access to the following files:
Leave a comment
Log in with itch.io to leave a comment.