I'm doing an isometric game and I would like to use height/normal data generated by a 3D program. Here's an example of an "object" data I have :
first one is the actual object, second one defines how high in world coordinate each pixel is, and the 3rd one describe what the normal for each pixel is.
Now, if I randomly place boxes on a screen, I am able to tell with the heightmap, for a given screen pixel (x,y), which box pixel should actually be rendered on top, this is what I call "pixel-perfect occlusion".
What would be the most efficient way to compute the final result of a scene (with the actual "box_color" images being drawn in the correct order) using this method? I can easily compute the resulting height map that would appear on screen using a shader , but how could this heightmap be used for correctly ordering the colored boxes?