Fix artifacts appearing on objects using distance fog #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! I absolutely love this effect, thanks for making and releasing it for free! I'm not sure if you still maintain it but I'd love to add a small fix for a problem I had.
When I first imported it I got some wicked artifacts appearing on close objects using distance fog only:
Stepping through the frame debugger I found that the fog render texture wasn't rendering at the same size as the camera, causing it to be up-scaled, causing huge artifacts.
I think this is because the effect is rendering in scene view and the size of the RT is being cached. I then made the scene maximize on play, causing the view port to be sized differently.
To fix this I've simply set the fogRT variable to create a new instance when the RT's size is less than the source texture's size. Pretty tiny fix but it drove me nuts for like 3 hours lol. I've also recompiled the Unity package with the new script for download. You can verify that only the script has been changed.
Also sorry the formatting is a little messed up, it's my first PR! I can try fix it if you'd like though it shows up fine in Visual Studio for me ¯\_(ツ)_/¯
Cheers!