So I want my game to be fully 2D (graphics wise), however I’d like for it to also have the illusion of 3D space, when it comes to shadows.
What I mean by this, is that I want the shadows to be cast on the ground (which currently is a flat sprite), in a way that makes it look as if the ground was actually laying down, instead of being a flat image standing up.
Basically I want it to act like shadows would in real life. You have a tree standing up out of the ground, going up towards positive Y axis, and the ground is flat, always being 0 on the Y axis, and the shadow changes orientation between the two axis (is projected from an object on the Y axis, onto an object on the X axis). This is the illusion I want to create, however both the ground, and the other object are standing up, towards positive Y.
As you can see, the ground sprite is in the same orientation as the tree (random object projecting a shadow), but I want the shadow to somehow go down the ground sprite and at an angle, creating the illusion that the ground is actually flat on the X axis.
The reason I can’t just rotate it in the editor, is because then it won’t be visible at all, since I’m using an orthographic camera. And even if I used a perspective camera, the graphics would appear very squashed.
This is basically a wall projecting a shadow onto the floor, in a 3D game, but I want to create this in a 2D game.
Something like Rockman X4 / X5 / X6, Rayman Origins / Legends kind of direction?
Then it’s all talk about art skills to mimic the 3D feel in 2D perspective.
No, I’m talking specifically about shadows. I need a way of projecting shadows onto objects at the same axis, in a way that makes them look like they’re on a different axis (projecting from a Y axis object, onto another Y axis object, so it looks like the second object is laying on the X axis).
I could put the ground behind the objects projecting the shadows, so that the ground can receive the shadows. But then I would have to make the ground in the style of those games, so that it doesn’t look like the shadow is just cutting into the dirt under the grass. (currently the ground is just a few pixels grass, and dirt right underneath).
That’s exactly what I want. But I don’t know how I would even do that.
My thought process, is that there’s no way of drawing a shadow, if there’s nothing specific the shadow has, that it can fall on. So if the ground texture is just a flat plane, how would I create the shadow, and how would I make it skewed.
Keep in mind that some of the objects making the shadows are going to be mostly conjoined, like a line of trees. So I can’t make a shadow sprite for every possibility, and then put it into the editor. Unless that’s not how you would go about doing it.
You make a normal 2D texture that you draw in your design program of choice with the shadow as you please.
Then place it in a way that looks below the tree.
I’m guessing OP wants a dynamic solution, like a shadow map but in 2D? I’d render the shadow sprites into a render texture (shadow map) that then gets drawn over the normal scene. Use a skewing shader when drawing into the shadow map so you don’t get any culling issues. Then just overlay the shadow map in a post process / full screen quad / using the Canvas & RawImage.