How can I add shading in a game like Terraria?

I want to make a game like terraria but Terraria’s shaders are very good. How can I do this? For example, how can I create shading so that blocks underneath other blocks are hidden? (Like in Terraria)



I want to create something like what’s shown in the images above, but how can I do that? I want the blocks at the bottom to be invisible. It’s something like shading, but the bottom part should be affected by it. I couldn’t figure this out in the lighting system. Thanks in advance.

You could tint the block underneath with a grayscale color. Which is?
image

How do I add color? With light? Could you give me a little more detail?

If the shading is dynamic and changes as the player moves past certain objects, then I’d suggest using the marching squares technique for the uncovered objects in a way similar to the GDevelop 5 - Fog of war demo.

It’ll probably require you to do a bit of work, research and trial & error to figure it out, but the effect will be what you’re after.

3 Likes

Thanks, but is there an easier way, or has anyone done something similar before?
Or do you have any resources, articles, or videos you can recommend?

What is the bottom part made of seperate objects or a tilemap or something else?

The entire bottom section consists of tilemaps.

Not Color but your tinting the color of the object to make it darker.


For example:
Without Tint:

With Tint:

My Events:

You could adjust the tint as much as you like and even make it dynamic with the current floor the player is standing on.

Would having a tilemap cause a problem?

To be honest, I have never used the Gdevelop tile map feature before :no_mouth:so I wouldn’t know. But feel free to test it out.

Okay, thank you. If you have any different ideas, feel free to write them down.