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

add horizon fadeout for fog effects #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

adQuid
Copy link

@adQuid adQuid commented Aug 16, 2023

Prevents bizarre fog glow when looking off of high places past the draw distance.

(also moved some lines over a tab, which I assume wasn't intended to be double tabbed)

prevents bizzare fog glow when looking off of high places past the draw distance
col = apply_fog(col, wpos, dir, max_dist, dyn_clouds, dyn_mist);
} else if (dir.z > 0){
float fogFadeIn = clamp(dir.z * 5.0, 0, 1);
col = apply_fog(col, wpos, dir, max_dist, dyn_clouds, dyn_mist) * fogFadeIn + (col * (1-fogFadeIn));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I think this would be clearer as

col = mix(col, apply_fog(...), fogFadeIn);

@zesterer
Copy link
Owner

Seems reasonable! Just one comment.

@adQuid
Copy link
Author

adQuid commented Aug 17, 2023

Thanks for reviewing so quick, but it looks like this logic breaks down on the coastlines, so let me work on it more.

@adQuid
Copy link
Author

adQuid commented Aug 18, 2023

Ok, try out this version. I ended up redoing the algorithm, but I think that this version works way better.

@zesterer
Copy link
Owner

Thanks. Any chance you have a screenshot showing a before/after? I'm unfortunately not in a position to check the code in-game right now.

@adQuid
Copy link
Author

adQuid commented Sep 6, 2023

The first is old, second is new. I excluded clouds in those screenshots since this change doesn't affect them much. Third screenshot is after the changes with the clouds.

old
new
clouds

@adQuid
Copy link
Author

adQuid commented Sep 6, 2023

bonus screenshot at the coast to show it still works in those conditions
image

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.

2 participants