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

Lightening the edge of the water #116

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

AntonioNoack
Copy link
Contributor

Light Blue Coastlines

Description

The coast line water looked dirty, because the sand texture was blended with the water, and apparently, the world ground at z ~ -32 has a different color.

This PR adds a light-blue shine to coasts, so they look tropical rather than dirty.

Before this PR:

image

After this PR:

image

Implementation explanation:

I wanted to lighten the coast, so I had to find out where the coast is. Luckily, the depth texture is already available to that shader, so you can calculate the depth difference between the geometry and the background. Then just multiply that by cam_dir.z, and you have the water depth.

Remaining issues:

Please don't merge this yet, this doesn't work with MSAA yet.
image
I don't understand/know WGPU well enough yet to understand that error :/.

@CLAassistant
Copy link

CLAassistant commented Jul 8, 2024

CLA assistant check
All committers have signed the CLA.

@Uriopass
Copy link
Owner

Uriopass commented Jul 8, 2024

Depth is different from distance so it actually looks weird at an angle but I have found out other games also do that trick and nobody seems to care so I'm ok with that.
The MSAA thing is from a time where I tried something similar, should probably not be a very complicated fix, it's about having the proper pipeline layout for the water shader

@Uriopass Uriopass merged commit 6995ab1 into Uriopass:master Jul 11, 2024
2 checks passed
@Uriopass
Copy link
Owner

Uriopass commented Jul 11, 2024

Fixed it.
Thanks ! Looks nice.

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.

3 participants