Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix artifacts appearing on objects using distance fog #5

Merged
merged 1 commit into from Apr 29, 2018

Conversation

Chikanz
Copy link
Contributor

@Chikanz Chikanz commented Apr 24, 2018

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:
artifacts

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.
frame debugger

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!

@OCASM OCASM merged commit e52e12c into OCASM:master Apr 29, 2018
@OCASM
Copy link
Owner

OCASM commented Apr 29, 2018

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants