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

Explore more control over light scattering through waves #52

Closed
huwb opened this issue Aug 21, 2018 · 6 comments
Closed

Explore more control over light scattering through waves #52

huwb opened this issue Aug 21, 2018 · 6 comments

Comments

@huwb
Copy link
Contributor

huwb commented Aug 21, 2018

Potentially add scattered light based on wave height, or some smarter scheme.

Originated from discussion in #33

@huwb
Copy link
Contributor Author

huwb commented Aug 22, 2018

@Midda-C @holdingjason

Added a height based scattering in the commit referenced above.

Best way to experiment with it is to set the Crest Colour to bright red! You can can experiment with the height range and and exponent/power and have some fun making alien planet ocean waves :).

I've used a similar term in previous projects and its worked pretty well. I thought of more complicated schemes but simplest might be best here. Its not very scientific - a good direction for RnD would be to offline render what the scattering looks like and actually try to approximate it..

Anyway let me know what you think. I'm pretty happy with the results im getting from this in the main scene (example content) on this branch..

@huwb
Copy link
Contributor Author

huwb commented Aug 22, 2018

Put it in a box :)

image

huwb added a commit that referenced this issue Aug 22, 2018
This will give more flexibility if we start varying the base scatter colour
@huwb
Copy link
Contributor Author

huwb commented Aug 22, 2018

Bonus feature time.. ive added an optional term for shallow water, in real life the ocean floor has a dramatic effect on the ocean colour due to all the multi-scattered light, and this attempts to approximate this effect:

image

Together these additions should give a much nicer range of colours from the water.

huwb added a commit that referenced this issue Aug 22, 2018
@Midda-C
Copy link

Midda-C commented Aug 22, 2018

Oh cool, I'd been thinking about making an issue for shallow water colour. Just tried it in our scene, it looks awesome!

I couldn't get the height lerp to do anything at first, but it turned out that Unity needed me to toggle it off and on again (it defaulted to on), which it kicked into gear. I assume that wouldn't be an issue on a new material. I think something similar happened a while back when you added a toggle to something else. Problem-Solving 101—try turning it off and on again.

@Midda-C
Copy link

Midda-C commented Aug 22, 2018

Oh, and it might be a good idea to clamp the Height max and depth power parameters, since they seem to break if they're set to zero.

@huwb
Copy link
Contributor Author

huwb commented Aug 22, 2018

Yeah i've had to do the same turn off and on again myself :/ i'll consider adding a note in the readme.

I've tweaked the ranges and merged it into master now. If you have any feedback or issues with it let me know and i'll reopen. Nice one!

@huwb huwb closed this as completed Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants