3dlibgdxshadows

libgdx fake 3d shadows


I'm writing 3d game with libgdx, and want to add fake 2d shadows on bottom of models. Now I'm using 2 planes with shadow texture and draw them a bit upper then floor planes. Everything is going ok, but when 2 shadow planes overlaps, there is a weird graphical artifact, because shadow planes have same Y(vertical) coordinate. What i need to do to avoid this? Maybe some texture on floor plane projection? If so - how?

example image http://itmages.ru/image/view/1497735/17ea1cdd

UPDATED: So i found another solution. You can use circle mesh for shadows instead of quad and don't let them overlap.

enter image description here


Solution

  • A dirty but working solution is just giving them a different Y position each. A very very very little difference, just enough to fix your problem but to be unnoticeable.