How to give FOW a soft edge around player

I have a FogTexture using a Shader Graph material and I use a camera set to clear flags with culling mask set to FOW (my fog layer, not rendered by the main camera). Then, I have a circle sprite as a child of my player that is set to the same layer. That way, as the player walks around, it clears the fog around them.

Initially, I was converting the entire texture to a PNG and saving that to persist the areas cleared by the player. This save file ended up very large, so instead I’m now logging the location of the player on a virtual 10x10 grid as the player walks around, so essentially the save file consists of a list of Vector2 representing every grid location the player has been. This is a much more manageable file size.

When the game starts, a script creates a new circle sprite on the FOW layer and loops through all stored Vector2 locations and moves the circle sprite once per frame to all locations, thus clearing everywhere the player has been.

There are issues with this method that I’ll work on eventually, but it created something interesting shown in the screenshot. The areas where the circle hit the fog for 1 frame have a nice faded edge while the area around the player (with ongoing contact with the FOW circle) has a hard edge.

My shader graph is built to create a soft edge, so that’s how the 1-frame cleared sections are that way. I think what’s happening is that by standing in one place for multiple frames, the gradient clears itself fully instead of leaving the gradient.

Does anyone have any suggestions for how to get the area around the player to have a soft edge?

Thanks for any thoughts.

detect when player stand in one place, and do not draw more cleared section repeatedly when that happen

That… certainly should work. I’ll give it a shot thanks!

Interestingly it didn’t work. I think it’s because as the player walks into the fog there are still multiple frames where the fog is being cleared. So by the time the player stops and the fog is not being cleared, it has already been cleared too much.

I think I’ll need to rethink my whole approach.