Hi,
i am programming an isometric game with a 3D map and objects on it that are 2D Sprites. These sprites also contain the shadow of the object, als partly transparent black area. I finally stumbled upon the problem of transparent regions blocking the view to objects behind them. I guess you are familiar with the problem, but i can give some screenshots if needed.
As i read one can solve this problem by drawing the objects in the right order. I don’t really like this idea because avoiding this was half the reason to use 3D maps instead of pure 2D. So i wonder if there are alternatives to this. I enumerate some things i thought about and would really appreciate some feedback on this.
-
One thing i thought about was drawing the objects without any shadowing and after that draw all the shadows. For this i’d need seperate Shadow Textures and would basically need to draw twice as many sprites. Is this in general a bad idea?
-
One issue that comes with the 2D sprites is that i can’t really create shadows and correct lighting on the object, for example in a days cycle. If i’d seperate the shadows, i could for example create 24 different shadowmaps for each hour, for each object, what sounds like a lot of effort. Does anyone have expereince with this, or knows any other methods to cast (good) shadows from 2D objects?
-
The lighting on the sprite itself should also change - a wall could be directly hit by light in the morning and be bright, and could be hidden from the sun in the noon and be dark. I thought about using another texture that basically encodes the normals of the surface of the object in color. With this i could directly calculate the brightness of the different parts of the object with a shader and render it correctly. Did anyone try this? Would this even work?
These questions aim at unanimated objects, like buildings. I also have animated objects, but i think i could live with worse lighting there, also because it sounds like a ton of work to create all shadows for all hours for all animations (or “normalmaps”).
It would be awesome to get some feedback and opinions, hints or links.
Greetings
Rongo