Search Unity

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,634
    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,685
    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,634
    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:
    3
    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:
    54
    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:
    9
    Hey there! is it possible to bake shadow masks with this shader?
     
  7. Cris_2013

    Cris_2013

    Joined:
    Nov 25, 2017
    Posts:
    31
    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,634
    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.
     
  10. gabrielgonzalez89

    gabrielgonzalez89

    Joined:
    Sep 16, 2019
    Posts:
    9
    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,634
    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:
    2
    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,685
    im getting "screen position out of view frustum" errors sometimes from the water
    whats causing this?
     
  14. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    410
    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,634
    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:
    2
    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:
    410
    @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,685
    yes it happens during gameplay
     
  19. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,634
    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.
     
  20. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    33
    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 at 8:56 PM
unityunity