Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Stylized Water 2 [URP] ☑️ Desktop/Mobile/Consoles/VR

Discussion in 'Assets and Asset Store' started by StaggartCreations, Nov 3, 2020.

  1. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    Right near the camera the fog density tends to be 0%, so for the first few centimeter the water will appear clear. You can use a negative value for the Start Distance parameter to have the fog begin somewhere behind the camera instead.
     
  2. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    sorry but where do i set a negative value? cant find it in the water / underwater rendereing
     
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    You can find this on the Underwater Renderer component:
    upload_2021-9-14_10-24-13.png
     
  4. T_dev

    T_dev

    Joined:
    Nov 13, 2019
    Posts:
    4
    Hello, StaggartCreations.
    I would like to purchase the wonderful assets "Underwater Rendering for Stylized Water 2".
    (I already own "Stylized Water 2")
    Before I do, I would like to ask you a question, if you don't mind.
    I'm working on a game that is more like a billboarding game, can I display sprites underwater with this asset?
    I would be grateful for your reply:)
     
    Last edited: Sep 16, 2021
  5. mandisaw

    mandisaw

    Joined:
    Jan 4, 2018
    Posts:
    55
    A question for when you return from vacation :) I've been picking up your assets since last year (had favorited for months, finally bought when URP support released), and tried some tests with Stylized Water v1/built-in renderer that didn't quite work out.

    Mainly it was hard to tell which "levers" affect which visuals, what the internal dependencies/links between settings are, and thus whether I'm on the right track or not.

    Would it be possible for you to do a couple of basic tutorial videos for the Water shader (built-in or URP settings, or ideally both), maybe just covering setup and a test case or two?

    The online documentation is great, and the demo scenes are good for like a big-picture/"all the bells & whistles" view, but having just a straightforward visual link between the API/Inspector and the resulting scene would be really helpful.
     
  6. gabrielgonzalez89

    gabrielgonzalez89

    Joined:
    Sep 16, 2019
    Posts:
    13
    Hey there! is it possible to bake shadow masks with this shader?
     
  7. Cris_2013

    Cris_2013

    Joined:
    Nov 25, 2017
    Posts:
    39
    Hi there,

    I am using Stylized Water 2 on Oculus and I have a weird issue, I've been looking into the documentation and tweaking values to see if I can fix it, but unfortunately I didn't managed to.

    I have a fountain in my scene (the player see the fountain from above, since the scene is some kind of diagrama), I use the circle plane included with the asset, and in the scene view everything looks great, however in VR the water looks weirdly transparent (almost if hurts to look at it), I've noticed this issue in some particle systems but disabling the "Soft Particles" on the mateiral fixed the issue.

    Now the weird thing is that when the scene starts the water looks just fine in VR, and then I have a huge world space canvas with some text that moves from behind the camera to in front of the camera (traveling above the water), once that plane moves then the weird effect on the water happens, the text uses Text Mesh Pro.

    Do you have any idea why would this be happening? or have any sggestion that can help me figure out a solution?

    Many thanks in advance!
     
  8. BMayzak

    BMayzak

    Joined:
    Nov 7, 2016
    Posts:
    22
    Hi! Love this asset and can't wait for future updates. One request; would it be possible to disable caustics in the Underwater Renderer package? The caustics look amazing on most flat surfaces but on my characters it makes them look strange (the faces of their models appear flat instead of smooth). Really beautiful water asset overall, though!

    Edit: Being able to remove certain game objects from receiving the caustics would work too, but don't know if that's even feasible
     
    Last edited: Oct 12, 2021
  9. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    To some extend, yes. But they'd be ignored by the fog effect. Sprites would need to use a custom shader, that incorporates the underwater effect directly. More details can be found here: https://staggart.xyz/unity/stylized...rendering-docs/?section=transparent-materials

    Videos aren't exact my forte I'm afraid, text can be updated and revised indefinitely. I agree an overview of the various aspects may be beneficial, but it involves a lot of tangents into general subjects such as lighting and shading that it ends up covering very little about the water itself.

    The sections and parameters in the material UI have tooltips with a brief description. But if you're aiming for a specific aesthetic, feel free to show a few examples, and I can try to break it down.

    Based on what you're describing, it sounds like you're running into the same bug as I described here. If so, this is a known graphics bug. The only solution so far is to disable MSAA, which is what's causing the issue for transparent materials (such as water).

    I've added a "caustics strength" parameter for the upcoming update (1.0.4), which will allow to override it specifically for the underwater rendering. A value of 0 will essentially make it invisible. Currently, disabling caustics on the water material will also disable it entirely underwater.

    The "faceted" appearance of the caustics you see on some curved meshes is technically by design, since a fast approximation is involved. On the render feature, you can enable the "Accurate Directional Caustics" checkbox (unity 2020.2+) to avoid these artifacts, though it comes with an added performance cost, how much will depend on other factors.
     
    mandisaw and T_dev like this.
  10. gabrielgonzalez89

    gabrielgonzalez89

    Joined:
    Sep 16, 2019
    Posts:
    13
    Any answer on baked shadows? I'd love to add those in my game as it would help immensely with distance shadowmask.
     
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    I checked it out, but lightmaps aren't supported by the shader. To my knowledge, transparent materials cannot be properly used with lightmaps, seeing as they'll block all lights, despite being not being entirely opaque. Shadows will be baked on the water surface, but nothing underneath it.

    I'll in any event add an item to my backlog to investigate support for GI, also since realtime GI support is underway for URP.
     
    MuntyMcFly likes this.
  12. jaydnwlsn

    jaydnwlsn

    Joined:
    May 28, 2019
    Posts:
    4
    Looking at potentially using this for a project that has varying weather events and changing wave properties. Just wondering if float transform can read the wave value changes during runtime out of the box/possibly with some lightweight code? Cheers :)
     
  13. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    im getting "screen position out of view frustum" errors sometimes from the water
    whats causing this?
     
  14. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Hey! Did this ever get released? I don't see it in the package anywhere....trying to do something like this and would love to play around or know details of how you did this! Is it using a different camera to render the decal(s) to a RT and then layering it on the water surface in the shader, or how does this magic work!?
     
  15. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    The Floating Transform component in particular, has a "Dynamic material" checkbox. If enabled, changes to the water material's wave parameters will be picked up. Though it's important to note that only wave height could be changed in real-time. Things like speed and frequency depend on trigonometry and will induce rapid movements when changed.

    This very likely stems from the planar reflections script. As as far I know, it's only possible this gets spewed out when a camera is looking directly at the X-axis. Is that something that happens during gameplay?

    It was a bit of a dead end, so I shelved it for the time being. The projectors are in fact rendered into a RT, from a top-down orthographic perspective, which is incorporated into the water surface. Though with this technique, they're only visible in a small area (or a larger one, but with very poor resolution).

    The alternative was the render them from the same perspective as the current camera, and incorporate it as a screen-space texture instead. Though with this technique the waves no longer affect them. At which point, just placing a regular plane above the water looks identical.

    It may be possible to simply use decals in URP 12+, which could get around both limitations, or introduce a set of its own :p
     
    DMeville likes this.
  16. jaydnwlsn

    jaydnwlsn

    Joined:
    May 28, 2019
    Posts:
    4
    Thanks for the quick response. Bought SW2 this evening and loaded up a demo scene. Can't seem to find any reference to "Dynamic materials" though. Here's a screenshot of the float transform component.
     

    Attached Files:

  17. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @StaggartCreations Ah, yeah I've been playing with trying to get something like that working the last few days and found the same issues you've described. I suppose maybe the distance issue could be resolved with some sort of cascade system but that might not be very practical. They just need to make decals work on transparent surfaces!! :p Appreciate the reply dude, you rock!
     
    StaggartCreations likes this.
  18. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    yes it happens during gameplay
     
  19. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    Apologies, I've been a doufus and mixed it up with the "Auto-find" checkbox. Practically speaking, the component should have a "Dynamic material" checkbox, I've added an item to my backlog for this.

    Meanwhile, you can simply modify the FloatingTransform script file and flick these two booleans to "true". upload_2021-10-22_11-3-29.png

    I can get the same result in the scene view when aligning an orthographic camera with the X-axis directly. Currently, there's a safeguard built in for the Z-axis (2D view). But I'll add this for the X-axis as well.
     
    jaydnwlsn likes this.
  20. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    142
    I wonder with what settings can i use this water on mobile devices ?
    Just tried BuoyancyExample - i got 2-5 fps on my device :( Do you have recommended settings ?
    ...
    It's possible to get 20fps with lamost everything off... but it's still no good. I see there some mobile shader - but is there scene example ? I need to create 'endless' sea with some floating ships
     
    Last edited: Oct 23, 2021
  21. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    Apologies, I had replied to your post last Monday, but now I see it has simply disappeared o_O

    If you haven't already, I recommend checking out the Performance Guidelines section of the documentation, which includes some general information about mobile platforms.

    The included demo scenes are all set up for desktop platforms, since project settings can greatly affect performance, they'd yield different results per project. Though, the StylizedWater_Mobile prefab is already set up for mobile use. The material applied to it does not have all the bells and whistles enabled.
     
  22. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    I have an update in the barrel for underwater rendering. There was always something missing, but up until now I wasn't aware what this was exactly. Turns out, a water surface also has reflections on the underside. Where, in part, the underwater fog is reflected. This is mostly perceived as a sort of "circle" around the viewer:



    The goal isn't to achieve photorealism, but I think the challenge lies in creating a believable effect, with ample control to bend the rules a bit.

    With this change in place, the surface now looks more similar to games such as Abzu, Uncharted 4 or Subnautica. This may inadvertently change the aesthetic for some projects, or require some adjustments. But it's a band-aid that I want to rip off rather sooner than later.
    upload_2021-10-28_16-13-31.png
    Two new parameters have been added to the "Underwater" section on the material. These control the smoothness of the reflection, as well as the size of the "circle".

    Shading for the underwater surface has been refactored to support this.
    Sparing any technical details, this brings a few benefits:

    - When using a skybox for ambient/indirect lighting, the surface and fog now match 100%
    - Water no longer appears "glassy" when the camera sits at the water level
    - The water shader and post-processing now work in complete tandem. A depth pre-pass for the Water Objects is no longer needed, cutting down on N number of draw calls. As such the "Frustrum Culling" and "Exclude Above Water" options have been made obsolete and were removed.
    - Normal map tiling now only measures distance to the camera on the XZ plane for the underside. As such, moving down vertically keeps the wave details crisp.

    Fog now has better practical applications. Previously, only horizontal density was controllable. Meaning, if the camera went down deep into the water, the surface would still be visible when looking up.

    Separate control over height fog is now exposed. Making it possible to create a (darker) vertical fog gradient, that runs down from the water surface.


    As a result:
    - The water gets darker and denser the deeper you go. Eventually flooding the screen with pitch black fog if desired.
    - Light scattering and sun reflection effects properly fade out into the fog

    The changelog for both the water shader, and the underwater rendering extension will be posted once the update goes live. It'll be required to update both packages to the latest version.
     
    mandisaw and Acissathar like this.
  23. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    looks nice!
    will we be able to disable the water horizon fog line? i cant seem to do that now. this is important to me as im playing in first person and theres an ugly thin colored line between the transitions when entering/ exiting the water.
     
  24. gamextar

    gamextar

    Joined:
    Jul 4, 2021
    Posts:
    8
    Any chance of VR support for the underwater extension ?
     
  25. gabrielgonzalez89

    gabrielgonzalez89

    Joined:
    Sep 16, 2019
    Posts:
    13
    huh... what is happening here?!
     
  26. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    I believe I know what you're describing, it's caused by the intersection/edge fade effects being visible through the water surface. I've implemented a workaround for this, which holds up quite well so far.

    Not likely in the foreseeable future to be honest. The reason being is because this requires a deep dive into how Unity does Instanced VR rendering, and reverse engineering parts of it. So far it seems like a woefully complex task, making other subjects a lot more enticing to work on.

    I can't really tell, but those lines appear to be shadows cast on the water surface by something.
     
  27. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    Updates are now live! Minimum supported version is now 2019.4.15 LTS and URP 7.5.3. Verified compatibility with 2021.2.0

    Stylized Water 2 - v1.1.5

    If in use, this version must be updated alongside of the Underwater Rendering extension v1.0.4.

    Added:
    - Support for lightmaps and realtime GI

    Changed:
    - Floating Transform component now has a "Dynamic material" checkbox. If set, wave settings are fetched each frame.
    - Sample positions on Floating Transform component now correctly work with prefab overrides.
    - Water Grid component will now regenerate the water tile mesh if it is missing. Allowing it to be used in prefabs.
    - Intersection Foam and Edge Fade effects now fade out when the camera sits extremely close on the water surface (excluded for rivers).
    * This avoids them being visible through the waves, causing a horizontal line.
    * Can cause slight visual warping, but this isn't noticeable for animated water​
    - Green vertex color channel now controls the depth color gradient, rather than Opacity. This allows all depth-based effects to be controlled through vertex colors
    * This behaviour still controls opacity when river mode is used.​

    Fixed:
    - Terrain appearing black/red in planar reflections when using more than 4 layers.
    - "Screen position out of view frustum" errors being thrown when using Planar Reflections with an orthographic camera aimed completely straight.
    - Sun reflection blowing out when using Gamma color space and HDR
    - Unused shader variants not being stripped when Tessellation was being used, causing longer build times on older Unity versions.

    Underwater Rending extension - v1.0.4

    Minimum required version of Stylized Water 2 is now 1.1.5. Verified compatibility with 2021.2.0

    Added:
    - Gradient ambient lighting now affects the underwater fog as well (equator color is used).
    - Parameter (component/volume) to multiply the caustics strength underwater.
    - Support for cascaded shadow maps

    Changed:
    - Refactored shading of the underwater surface and fog:
    * Surface now partially reflects the underwater color, creating a more believable appearance.
    * Fog floods the water surface as the camera goes deeper, eventually covering it completely.
    * Two new parameters are added to the "Underwater" tab on the water material, controlling aspects of the underwater surface.
    * Underwater fog now has separate control over vertical/horizontal density. With added height fog controls.​

    - Performance optimization:
    * A depth pre-pass for the water surfaces is no longer needed, cuts down on N number of draw calls.
    * In Unity 2021.2.0+, 2 frame buffer copies can be skipped, by making use of an improved feature.​

    - Waves & Caustics are now also disabled if they are on the water material.
    - Shader Graph node to apply fog now only modifies the Emission value. Lighting is now incorporated into the fog color. This ensures scene lighting doesn't interfere.

    Fixed:
    - Fog and water surface not matching entirely, when using a skybox as the ambient light source.
    - Objects underwater, in front of the water surface, also being refracted (Limited to the Advanced shading mode).
    - Rendering no longer takes effect for 'preview' camera's. Otherwise affects asset thumbnails generated while underwater.
    - Shader error when building to PS5.

    [Documentation will be updated today, to reflect any changes]
     
  28. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    142
    What is minimal shader version required to run this ?
    Android Demo running great - but how can i open it in editor ? In demo folder there're much more complex scenes and i can't get it run with good fps :(
     
  29. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    142
    StylizedWater_Mobile prefab seems to be very basic. Can you share android demo scene ?
     
  30. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    A useful quote:

    The mobile demo APK uses the same settings as the StylizedWater2_Mobile material does, in terms of enabled features. The exception being that skybox/environment reflections are also enabled. But the scene also has no shadows, post-processing, and a just simple model (using the Simple Lit shader). The difference may lie there.

    But the other side of the coin, is the pipeline settings used. For the mobile demo, I have essentially dialed back everything:
    upload_2021-11-8_9-22-29.png
     
  31. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    142
    Thanks :) But could you please just share demo scene with me ? This way i can be sure that everything is right.
    you can skip StylizedWater folder - i will add it myself.
     
  32. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    Sure, no trouble! I had to exclude the island model, since I can't find the source and thus the associated license.

    Edit: I'm working on a more extensive mobile demo, which will also allow to toggle shading features on/off. To get a better idea for how much the device can handle.
     

    Attached Files:

    Last edited: Nov 13, 2021
  33. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    577
    upload_2021-11-10_14-46-9.png

    Hi. I'm starting a URP project and trying Stylized Water 2 for the first time. The demos don't seem to have reflections, refraction, blur or anything else. The editor is set to quality and it's running on a fast desktop PC. Can you help? How should reflections look?
     
  34. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    Thanks for the screenshot. The bright spots you're seeing is the scene reflection. With the "Curvature mask" parameter turned all the way up, the reflection only becomes visible under grazing viewing angles. If you were to turn it down, the water appears more like a mirror, showing a very strong reflection.
     
  35. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    577
    upload_2021-11-12_9-19-19.png

    I turned the curvature mask almost completely down and it still seems to only reflect the skybox, without catching the smaller objects in the water. The stack of crates and diagonal pole should have conspicous reflections here.

    I tried turning off the waves and manually moving the reflection probe, but this was the best I could manage.
    upload_2021-11-12_9-22-42.png

    Perhaps I have a misunderstanding of what to expect from water reflections. I was expecting realtime reflections of moving objects such as boats, etc, as well as proper reflections from bridges.

    Is the reflection intended mostly for skybox and terrain? I fully understand if this is the case, I just want to make sure I properly calibrate my expectations.
     
  36. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    Ah, I see what you mean. With reflection probes, the reflections are capture from a single point, so the further the camera moves away from it, the more the reflection starts to diverge. For the skybox this doesn't matter, yet it becomes obvious for specific objects. Planar Reflections is an alternative best suited to 1:1 reflect scene geometry.
     
  37. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    577
    Unity_cEOL3PkM1y.png

    Oh I completely missed the fact that planar reflections are handled separately! Just what I needed. Thanks!
     
    StaggartCreations likes this.
  38. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    mandisaw likes this.
  39. Calamitycal

    Calamitycal

    Joined:
    Jul 6, 2014
    Posts:
    35
    Having an issue with Azure Sky Fog and the water in URP. After activating the plugin, and adding the sky to the scene, the water turns white and transparent. If I turn off the depth texture in the water, it goes back to looking correct, but then I lose the shoreline and the water doesn't look as good. Images attached.

    upload_2021-11-22_10-36-22.png

    Changing the depth texture setting in the pipeline has no effect.

    Anyone else encounter this and find a fix? Thanks!
     
  40. Calamitycal

    Calamitycal

    Joined:
    Jul 6, 2014
    Posts:
    35
    Quick follow up. Changing the render queue to "From Shader" and then turning the depth texture back on seems to have fixed the issue. Although the white now appears around anything in the water, so not ideal, but better than not having the shoreline at all.
     
  41. a_loupas

    a_loupas

    Joined:
    Mar 17, 2021
    Posts:
    16
    There is a little problem that I have. If you look up closely a black line appears. Any idea why that is happening ?

    upload_2021-12-3_12-40-14.png
     
  42. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    This may be happening is shadows are enabled in the pipeline settings, but nothing in the camera view is casting shadows, providing the water with a broken shadow map. This is because the shadow map only updates when shadows come into play.

    You could set the shading mode to "Simple" to get around this:
    upload_2021-12-4_9-52-5.png
     
    a_loupas likes this.
  43. LogaNRV

    LogaNRV

    Joined:
    Jun 3, 2017
    Posts:
    35
    Does the "receive shadows" option work with point light shadows?.
    I'm working with Unity 2021.2.3 (URP 12.1.1) and have between 1 and 4 point lights per zone.
     
  44. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    Not at the moment. This was purposely disabled to reduce the number of shader variants, which otherwise increases exponentially, affecting build times. I'll look into incorporating this into the shading, which will be quite simple, it would require to uncomment a single line in the shader file afterwards.
     
    LogaNRV likes this.
  45. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    As it turns out, this is in fact a bug in the shader. Or rather an incorrect use of URP's shadow function, which isn't taking the far end of the shadow range into account. I've meanwhile fixed this for next update.
     
    a_loupas likes this.
  46. SamFZGames

    SamFZGames

    Joined:
    Mar 2, 2014
    Posts:
    37
    Question - When I add an Underwater Renderer to the scene, it says "MSAA is enabled, this causes artifacts in the fog" - Do we really have to turn anti aliasing off just to use this? Because I think that's a big sacrifice...
     
  47. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    You can still leave it on, and not run into any artifacts. Though this depends on the context of the scene.

    The reason this warning is there is because the MSAA technique only applies AA to the image's color, not the underlying depth texture, which is what the fog uses to measure distances.

    The result can be that you can see these "unfogged" pixels around the silhouette of objects. Most extreme when the skybox is behind the object, or with large terrains.
    upload_2021-12-14_11-20-4.png

    It may not be noticeable at all in your game, but having MSAA enabled won't break anything ;)

    The Anti-Aliasing options on the camera don't have this limitation, since it filters out aliasing at the end of a frame.
     
  48. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    Version 1.1.7 is now available!

    Added:
    - Support for spot/point light shadows in Unity 2021.1+/URP v12+ (requires the "Receive shadows" option to be enabled).
    upload_2021-12-14_11-34-40.png

    Changed:
    - Caustics effect is now influenced by the sun light's intensity. Spot/point lights will create a localized caustics effect.
    upload_2021-12-14_11-37-31.png

    - Lighting no longer applies to the reflected image, since it is already lit. Added parameter to control this behavior.
    upload_2021-12-14_11-44-59.png

    - Improved translucency shading for point/spot lights, now visually behaves the same as it does for a directional light.
    - Improved light reflection for rivers, now takes the mesh's curvature into account.
    - Warning is now displayed in the material UI if the render queue set is illegal.

    Fixed:
    - Specular reflection for point lights still being calculated when Light Reflection feature was disabled.
    - Shadow mask used for the sun reflection/translucency did not take shadow fading into account.
    * The "Receive shadows" must be now be enabled to mask these effect. Shadow strength can still be 0.

    Future work

    Support

    Unity 2019 LTS is on its deathbed, and LTS support is ending next spring. Given the improvements to URP in 2020.3 and 2021.2, it's unlikely this is still being used.

    Early next year, the minimum supported version will be 2020.3, and updates/fixes for 2019 will discontinue (practically: it won't be tested on it anymore).

    Material UI
    Currently, selecting multiple water materials isn't supported. Frankly, due to a design flaw I noticed too far in. The upcoming Material Variants wouldn't be supported for the same reason.

    In order to fix this, some material parameters have to be changed and added. The consequence will be that some settings/features will revert to their default values on water materials. For the material included in the asset, I can correct this.

    Nobody likes breaking changes. But it's a band-aid that has to be ripped off sooner than later. It'll be the focus of version 1.2.0.

    Demo project

    I'm in the process of setting up an "extended demo" project on GitHub. This is not officially part of the Stylized Water 2 asset. It serves mostly as a playground to test and demonstrate use-cases:

    - Water entry/exit triggers
    - Physics-based buoyancy
    - Vertex colors, for pre-computed effects
    - Faux water surface raycasts
    - Caustics through decals and light cookies

    It'll hopefully serve an example for a bit of out-of-the-box thinking, regarding the possibilities.

    Surface Modifiers extension
    A continuation of what I prototyped last year. I've completed the necessary base framework to build this on. It will allow top-down projected "decals" to be incorporated into the water surface. So far, the following layers are slated:
    - Albedo color
    - Normals
    - Vertex Displacement (XYZ)
    - Foam

    Static textures or animated materials can be used with some creativity to create a whole host of effects.

    - Ocean waves
    - Whirlpools
    - Water ripples through particles
    - Boat wakes
    - Shoreline waves
    - Advanced rivers with dynamic flow directions
    - Debris floating on the water (duckweed, grime, oil spills, blood, etc...)

    So far conceptual, but I'm nearly ready to get started. Performance is paramount, and making this efficient will likely make up over half of the work (cascaded rendering, fast culling and dynamic batching). But I'm optimistic, it'll just take time.

    New year sale
    Both the Water Shader and the Underwater Rendering extension are 50% off during the current sale.

    As always, if you're familiar with the asset, and found that it made a difference, please consider writing a review. These really go a long way!
     
    LogaNRV and Acissathar like this.
  49. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,896
    Proof of concept for "Surface Modifiers".

    I've gotten as far as implementing the basics for rendering, and incorporating the result into the water shader. It's comparable to Deferred rendering, so any kind of custom shader can be created to modify the water. Otherwise not possible without driving the water shader's complexity straight through the roof.

    Seen here is a displacement, albedo and foam modifier. Normal map modifiers are also possible, but don't blend correctly at the moment. Height displacement is converted to a normal map, so it properly affects lighting and reflections. A prime example for displacement modifiers is creating localized waves (eg. Sea of Thieves)



    The shoreline wave and animated foam is made using Shader Graph, and gives a good idea of what's possible with a little creativity.
     
    Last edited: Dec 17, 2021
    DMeville, LogaNRV and Acissathar like this.
  50. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    348
    Interactive water (extension asset)
    Is this one still planned?