r/howdidtheycodeit • u/locotony • Mar 24 '23
How to give dynamic shadows collision?
/r/unrealengine/comments/11u7bv3/how_to_give_dynamic_shadows_collision/
0
Upvotes
r/howdidtheycodeit • u/locotony • Mar 24 '23
2
u/BMcFrizzle Mar 24 '23
I'm not sure how they accomplished this effect, but I doubt they actually used collision on the shadows themselves.
1
u/locotony Mar 24 '23
This is question I posted to the unreal subreddit that seems more relevant to this sub.
I think ninjazombiemaster second guess seems close to the approach taken. Rather than tying shadows to the logic you just have the art direction back up invisible collision.
Would like to hear other explanations as well.
3
u/CowBoyDanIndie Mar 25 '23
I only looked at the first example so this might not apply directly to all… So, if you spend a little bit of time learning the matrix math behind how 3d rendering projection works… you will realize you can project the actual object vertices onto any plane without even rastering. Then you treat the plane as a 2d game doing 2d collision between the lines and other objects. Shadows on a plane are easy like that, its shadows on complex surfaces that require a discrete shadow map.
1
u/moonshineTheleocat Apr 07 '23
Its a neat illusion.
The shadows are not actually physical objects. Nor are you actually controlling anything in the shadows.
The actual gameplay is happening on the 3D geometry of the level. The shadows are simply used to display the game.
1
u/totallyspis Apr 12 '23
This is pure conjecture, but, could be some trick involving shadow volumes. You could maybe implement a technique that takes the points found when projecting from a light source and constructing a 2d collision shape out of it