wave-harmonic / crest

A class-leading water system implemented in Unity
MIT License
3.45k stars 476 forks source link

Question: how to achieve a stylized look #259

Closed taylank closed 1 year ago

taylank commented 5 years ago

Sorry if this is not the right place to pose this question, I could not find a Unity forum for Crest. I'm wondering what my options are if I want to use Crest within a cel shaded or flat shaded art style. Post-process edge detection does not work well as it does not seem able to detect wave forms; all I get are flat rectangles on the ocean surface. Since Crest has its own shaders, a shader based option would have to modify the those I assume?

Has anyone achieved any success along those lines?

Midda-C commented 5 years ago

There's a branch with some minor changes to the ocean shader which allows you to customise the falloff of the fresnel (how reflective the water's surface is). It can be seen here: https://github.com/huwb/crest-oceanrender/tree/feature/stylised-fresnel

We're using it in our project with good results. While our game isn't exactly cel-shaded, it's still rather stylised, and it fits together well.

image

This is the fresnel falloff ramp we're using at the moment to achieve this look:

image

Combined with a strong foam-sim with a rapid falloff, it gives a nicely stylised look.

taylank commented 5 years ago

Thanks @Midda-C . I tried that and it rather killed my frame rate; it's almost half of what it was using the main branch. Is that your experience as well or does it mean something's not right?

Midda-C commented 5 years ago

That sounds like something's not right, I don't expect it should really have any noticeable impact on the framerate one way or the other. I actually just took the changes to the fresnel section of the ocean shader and applied it to our local file, you should be able to do the same.

I believe that branch is quite old, so it might be better to just take the latest Crest from main and merge in that modification. The changes are pretty minor, and even I was able to do it with my near-zero coding experience by just looking at the diff here: https://github.com/huwb/crest-oceanrender/commit/827f7fafdcef147c38ef8b40689c7183f791520e

taylank commented 5 years ago

Alright that does look better, thanks! By the way, are you using the Light Weight Render Pipeline? Or do you know if the fresnel ramp works with LWRP?

Midda-C commented 5 years ago

Nah, we're just using the built-in render pipeline. SRP didn't exist when we started our project, unfortunately.

I haven't looked at the LWRP version of Crest at all, but I assume it'll slot into the shader fairly easily. That's more of a question for @huwb, though.

huwb commented 5 years ago

yeah right now its only in the github version. @taylank do you want it in the lwrp version?

taylank commented 5 years ago

@huwb I was on the fence on buying the LWRP version, but yeah, knowing I can have this feature in lwrp would definitely make it an easier decision.

hedgefield commented 5 years ago

This looks amazing, thanks!

huwb commented 4 years ago

Unfortunately we won't be able to support this in LWRP / URP, at least not by default. We are going down a shadergraph style route, so that ultimately people will be able to easily modify/extend the ocean material graph. A constraint with this is that we don't automatically have control over reflection to stylize it in the way this issue suggests. There might be a route to doing it but i thought I'd post this note with my current/best knowledge about it.

transat commented 4 years ago

What would be the recommended settings to achieve close to this look in the URP version of Crest if the above modification is not possible?

Jeanseb05 commented 4 years ago

Would like to know aswell !

transat commented 4 years ago

This feature still works @huwb Any chance it could be integrated?

huwb commented 4 years ago

Integrated into the built in RP do you mean?

transat commented 4 years ago

I meant integrated Into the URP ocean shader. I've had to modify the URP ocean shader after Crest updates to re-enable the custom fresnel falloff ramp.

Zesix commented 3 years ago

+1 on integrating it into URP. I am building a stylized environmnet using Crest and have been contemplating switching to a different water solution. Having this added would be very nice. 2020-09-20_Added_Atmospheric_Height_Fog_for_Stylized_Night_Mist_and_Ocean_Glow

huwb commented 3 years ago

There is light at the end of the tunnel - on the very latest version of Unity it seems like we may be able to ship the ocean shader as a shadergraph, which would enable easy customisation. I will follow up later when there is news.