I am currently in the process of designing an Isometric game, and one of the features we are trying to add, is using sprite depth maps to render geometry in the correct order.

The reason we are trying to do this, is a number of our game objects make use of overlapping sprites, and the animation is not always in sync with it's other parts.

I do have experience with working in 3D. But the issue comes to using something that is normally generated on the fly, pre baking it, and then retrofitting it to work with what ever distance.

So... something similar to what the sims has done with it's objects.


  • \$\begingroup\$ Just render everything from back to front \$\endgroup\$ – Bálint Sep 6 '16 at 19:54
  • \$\begingroup\$ @Bálint I think you've missed the problem :P. When you have objects made of multiple overlapping sprites, it's tedius to constantly swap their rendering order. \$\endgroup\$ – moonshineTheleocat Sep 6 '16 at 20:38

You can pretty much think of this as deferred shading.

At least if I understand your question correctly, you are asking how to handle depth information that is stored in a texture for a sprite you are rendering.

If you have experience with 3d reading up on how deferred shading works shouldn't be hard.
The method used in the sims seems to be very similiar to just adding the appropriate depth to how you would render a billboard into a G-buffer.

| improve this answer | |
  • \$\begingroup\$ Deffered shading doesn't have to do too much with depth buffers. It's only used to make lightning calculations easier by making light calculations happen only once for everz pixel \$\endgroup\$ – Bálint Sep 7 '16 at 14:26
  • \$\begingroup\$ The core of how it works is in being able to reconstruct world positions in the pixel shader from depth information in the G-Buffer. You would deal with sprite based depth information in essentially the same way you do when you render with deferred shading. I'm not saying he should use deferred shading, I am saying that if you check out the math involved in deferred shading, for which a lot of ressources exist, then doing this will be trivial. \$\endgroup\$ – Nils Ole Timm Sep 7 '16 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.