combine sprites using z-depth maps

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By notrly1337


I am making sprites for an isometric RTS. I have an air transport unit (dropship) which carries other units outside the fuselage - they basically hang outside so they are visible when loaded and can interact with the environment (shoot, get shot, etc). Something like this.


I want to use my existing nodes and sprites for the boarded units and combine them with the empty dropship sprite using z-depth maps.

This Blender screenshot illustrates the effect I am trying to do in Godot.

I don’t want to create dropship sprites carrying various configuration of units as I also want the boarded units to play sprite animations which would make the total frame count too high.

:bust_in_silhouette: Reply From: QuincyTDrake

It is possible to export a depth map from Blender as an OpenEXR floating point image, that you can then use in a custom shader in Godot to give your 2D billboard sprite depth. The custom shader simply needs to read in the depth from the OpenEXR depth image, and adjust it for the camera differences between Blender and Godot, if you have exactly the same camera setup it’s a lot easier.

I describe the basics of the technique here.

Thanks mate ! Very nice article !

notrly1337 | 2021-10-05 21:15