How can I hide a tile until it comes into view of the character?

Godot Version

4.3

Question

Hello!
I have created a 2D procedural “dungeon” that has different rooms and corridors separated by doors which open when you get close to them.

I want to create an effect where the layout of the rooms is hidden to the player until they enter it.

At the moment, the entire map is visible right from the start.

I considered using raycasting to see what was visible to the player, but I can’t find a way to toggle a tile’s visibility.

I also considered using another map layer as a mask, but I can’t figure out how I can allow the background to show through.

I finally considered using a light2D, but it’s not quite the effect I want. I’d like for the tiles to remain in view once they have been revealed.

I am sure that there is a way to do what I want, but I’m new to Godot and am having trouble searching for answers.