Hey Godot Users, I’m having an issue I hope maybe one of you could solve. I am working with a TileMap (Terrains, specifically, not sure if that matters), and I added occlusion to tiles. The occlusion is working perfectly, however, I wanted the textures under the occluder to also take in light. I found a discussion from 2016 with someone having the same issue, but they were on Godot 2, and they were using Sprite2Ds and OcclusionShape2Ds, rather than Godot 4 and TileMaps. I set up the same scene in Godot 3, and the effect I want works perfectly, but if I do the same thing in Godot 4, it doesn’t work.
Basically, to sum it up, the textures of tiles are affected by light and also occlude, in Godot 3, and in Godot 4, it only occludes and doesn’t get lit up.
I think this is a rendering issue that will be difficult for you to solve. Rather, you will need to find a workaround. Here are two standing issues in the GitHub which I believe are related to your issue:
If you have a GitHub account, it might be a good idea to “like” those issues to help show the maintainers that you would like the issue to be prioritized.
As for a workaround, it will be easier to provide suggestions if you could show screencaps of your setup and how it’s looking vs how you would like it to look.
This isn’t the issue I’m having, but I appreciate the effort(I don’t mean to sound sarcastic btw), also sorry for not adding the screencaps before, when godot Q&A changed to the forums, my account got deleted, so I can’t post more than two pictures at a time, I’ll try to send them in different replies.
Regarding my issue though, here is my scene working perfectly in Godot 3:
Notice how the wall is lit up, and it’s also occluding, this is how I want the scene to work (The light source is placed under where the wall is to avoid that issue you replied about).
And then here is the Godot 4 version of that scene, everything is done the same except for the placement of tiles, but you can still see how it doesn’t work:
The wall isn’t lit up, but it still occludes. This is the self-shadowing I was speaking of earlier, and I’d like to make it so the wall is lit up and occludes, like in the Godot 3 image.
I know a workaround, but it’s a bit tedious. It requires your walls and your floor to have different CanvasItem Light Mask layers. Of course, this is a feature TileSets don’t have, which means it requires two separate TileMaps, one for the walls and one for the floor.
The floor TileSet is normal, but the walls TileSet needs two occlusion layers: one for occluding the light for the floor, and one for occluding the light for both the floor and the walls. The “side” walls get the one occluding only the floor, while the “ceiling” walls get the one occluding both.
That does make sense, and it’s gonna be really tedious to set up, but as long as it works, i’m happy. I had already seperated the floor and walls, but hadn’t put the walls and tops separately. Thanks for the help! I’ll let you know if it works
Just making sure: You don’t need a separate map for the walls and the ceiling, if that’s what you think I meant. You can, fortunately, assign different occlusion layers to different tiles in a tileset. Just not different light mask layers.
Ok, saying I appreciate you would be an understatement, this problem has been bugging for like the past month or so, and the original Q&A site was down, so I had no clue what to do. Thankfully though, you showed up. I appreciate it so much, thanks!