Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. alex_1302

    alex_1302

    Joined:
    Aug 20, 2019
    Posts:
    54
    hi. i have a problem with stylized water 2 on urp: if you look the picture you will see the character's hair has rendering problems, these artifacts are affecting other objects too, like the buildings. This happened after use stylized water 2 on my urp project. i think it could be something affecting z order, maybe could be useful to mention i am using beautify plugin, but in other scenes where i use beautify and no water effects the rendering works well. Thanks for any help to resolve this problem.

    upload_2023-7-13_20-54-34.png
     
    Last edited: Jul 14, 2023
  2. alex_1302

    alex_1302

    Joined:
    Aug 20, 2019
    Posts:
    54
  3. Antilight

    Antilight

    Joined:
    Oct 19, 2018
    Posts:
    7
    Hi! In my URP project I have 3 cameras: background (base), player (overlay), and UI (overlay) on top. The background camera renders my own dynamic skybox which includes moons, stars, meteor showers, and other stuff.

    Is there a way to assign the underwater effect to an overlay camera? Having a background camera is really important to my project.
     
  4. alex_1302

    alex_1302

    Joined:
    Aug 20, 2019
    Posts:
    54
    In the end it seems that the problem with the character's hair and the buildings was a z fight problem. I did resolve it changing my camera's near clip plane from 0.01 to 0.1 and the camera's far clip plane from 5000 to 3400. After that i test it on movile and the artifacts dissapeared. Is strange but on other game level (scene) that problem wasnt visible. The only difference was that one used water and the other did not. apart of that, one is nearest from the origin (0,0,0) than the other one.
     
    Last edited: Jul 19, 2023
  5. Yureck666

    Yureck666

    Joined:
    Feb 6, 2019
    Posts:
    1
    Hello
    Faced problems when using the asset together with "dynamic water physics 2".
    Objects do not move on the surface of the water, but as if on some other one. The water facility has a provider from the asset.
    There is also a problem with very low performance on mobile devices. With only one water plane, the FPS on the phone is only 10-15 frames. I turned off all extraneous graphics functions.


     
  6. mcapdegelle

    mcapdegelle

    Joined:
    Nov 7, 2014
    Posts:
    29
    Hi, I found a little "bug" : The rendering of the density is slightly different depending if you are in River/Standard mode, (given the exact same parameters)

    upload_2023-7-24_17-8-10.png

    This comes from this bit of code in Shaders/Libraries/ForwardPass.hlsl, line 165
    Code (CSharp):
    1. #if !_RIVER
    2. //Use green vertex color channel to control density
    3. density *= saturate(density - mask);
    4. #endif
    5.  
    6. return density;
    Assuming a mask value of 0, the density is squared in standard mode, not in river mode. Could be fixed with :

    Code (CSharp):
    1. #if !_RIVER
    2. //Use green vertex color channel to control density
    3. density *= saturate(density - mask);
    4. #else
    5. density *= density;
    6. #endif
    PS : Love this asset, really nice work :)
     
  7. NeolithicJames

    NeolithicJames

    Joined:
    Feb 28, 2018
    Posts:
    3
    Hello, I am having trouble getting refraction to show up. I have the depth texture enabled and it works for other shaders, but I am still getting a gray tint and no refraction on the water shader as seen in the FAQ. upload_2023-7-24_12-58-52.png
    Unity version 2020.3.44f1 URP with Singlepass instanced VR, but refraction does not show up in the editor either.

    Here is my rendering pipeline asset:
    upload_2023-7-24_13-0-21.png
    And Camera settings:
    upload_2023-7-24_13-0-57.png
    I am also using Enviro fog integration, not sure if that changes anything but the fog does appear to render correctly and the Camera Opaque texture does render on other shaders, I did a test material and it showed up correctly.
     
  8. watchagames

    watchagames

    Joined:
    Oct 1, 2017
    Posts:
    25
    Hi love the asset,
    Cleaning my fog stuff, I'm removing SCPostEffects which I used for fog.

    I have hard time finding where I disable SCPostEffects integration in StylizedWater.
    Deleting the SCPostEffects folder makes the Water rendering disapear. and also the Hub Windows still says that the integration is installed for SCPostEffects.
    (so probalby SCPostEffects is defined and this the shading goes wrong?)
    Q: what is the proper way to remove SCPostEffects ?
    Thanks
    Nicolas
     
  9. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,267
    How would I programatically disable the underwater render in a box collider. I have a fixed point for the underwater render of Y:-2.1 but when I enter dungeons, I get post processing effects. I want to keep the fixed point but disable it in dungeons and cave systems withing my map.
     
  10. r_chevallier

    r_chevallier

    Joined:
    Apr 20, 2014
    Posts:
    31
    URP material is not loading. I recently updated Unity to version 2022.3.5f1 and now water is pink. Unity did give me a message it had to reload all the materials to use the updated version of URP.

    Error message:

    Shader error in 'Universal Render Pipeline/FX/Stylized Water 2': redefinition of 'sampler_LinearClamp' at Assets/StylizedWater2/Shaders/Libraries/URP.hlsl(22) (on d3d11)

    Thank you,
    Raymond
     
    Last edited: Jul 29, 2023
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Back from a vacation, so am able to reply to all the messages now! I had an away notice in my forum signature, hope that was visible enough!

    Unfortunately the effect won't work correctly on an overlay camera, due to how URP handles the depth texture on said camera's. It may work though, since skybox elements are at infinite depth anyway.

    You'd have to remove this part of code from the UnderwaterRenderFeature class to remove the overlay camera failsafe:
    upload_2023-7-30_10-46-19.png

    With regards to DWP2, the Stylized Water 2 asset merely provides it the means to read the water's height. I can see in your videos this works as intended. I suspect its an input/controller issue if a ship isn't moving forward.

    For performance, I'd recommend consulting the profiler to pinpoint bottlenecks.

    It's best to keep the "Count" parameter to 1 (under the Waves) tab on the material. This will also simplify the calculations DWP2 does, which it may be doing up to 100-200x per frame.
    Thanks for the heads up! There is indeed a difference for rivers, where the vertex color controls the actual transparency of the material. For non-rivers this controls the depth instead. So this can certainly account for any differences.

    The density shouldn't be squared actually (oops), merely the mask needs to be subtracted. I'll see to correcting this!

    Thanks for the details!

    Since you mention Enviro I'm fairly sure you're running into the exact same issue as another user a while ago (using Enviro v2). The issue lies with Enviro's fog function applying a grey (uninitialized) texture to the water. I don't know the exactly details as to why.

    What you can do as an alternative is to disable the fog integration for the water shader:
    upload_2023-7-30_11-7-47.png

    If you were to remove SCPE from your project, the water shader will indeed throw an error about a file going missing.

    What you can do is to select the water shader (in the Stylized Water2/Shaders folder) and hit the big "Recompile" button. It will then detect that SCPE is not present in the project and remove its integration as well.

    It won't be possible to have the fog stop at a certain point, as in being contained to a volume. But it is certainly possible to toggle rendering on/off through a Box collider trigger.

    I've outlined more details about this set up in a previous post here: https://forum.unity.com/threads/sty...mobile-consoles-vr.999132/page-8#post-8137550

    You can also set the public static UnderwaterRenderer.EnableRendering boolean to true/false depending on any kind of conditions you want. If it is set to false, rendering will be skipped entirely.

    This version would require the latest version of Stylized Water 2 as well, since this includes a fix for this particular error (indeed occurs in recent URP versions).
     
    mcapdegelle likes this.
  12. Balours

    Balours

    Joined:
    Nov 27, 2013
    Posts:
    59
    Hey there!
    I was wondering if it was possible to add a scroll speed with a direction to the normals. I want to simulate the flow of a river, I know there is a River mod but that's not what I need for my project. Is it possible or do you thing it's a simple add?
    Thanks a lot.
     
    Last edited: Jul 30, 2023
  13. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    On the water material, under the "General" tab, there is a Direction parameter:
    upload_2023-7-31_11-6-3.png

    The direction corresponds to the XZ axis in the world.

    For the normals you can also multiply the speed:
    upload_2023-7-31_11-7-26.png

    Note that if River mode is disabled, the normals also flow back in the opposite direction a little (in an upcoming update controls will be exposed to reverse this behaviour)
     
    Balours likes this.
  14. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    hi i created a ssr reflection for your water asset and wish to use in my bussiness project instead of plane reflection, if you want the code i will send to you.
     
    Bwacky likes this.
  15. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Submitted version 1.5.0! This is major feature and usability update, and may change the appearance of your custom water materials, which would require some minor readjustments. Please to say to existing revenue enables this to be a free update.

    These are the last updates supporting Unity 2020. There are a number of reasons why this has to be left behind. Future updates may still work, but things like prefabs tend to break as they are not backwards compatible.

    Changelog:
    This includes the two new features: Color Absorption and Screen-space Refraction



    A notable UI change is that there's now controls exposed over the 2nd texture sample used in the Normal map and Surface Foam effects. By default this sub-layer was always tiled at half the value and moved in the opposite direction, but now its possible to achieve greater visual variety:
    upload_2023-8-4_10-35-7.png

    Translucency shading now takes surface curvature into account more accurately, making it more prominent on wave slopes:
    upload_2023-8-4_11-16-29.png

    Surface foam now has improved control, where it appears to dissolve based on the input intensity. That being a general base amount, wave crest and/or vertex painting:
    upload_2023-8-4_11-39-47.png

    Finally, a new premade "Swamp" material is now also included:
    upload_2023-8-4_11-36-32.png

    The Underwater Rendering extension has a few dependencies and was also also updated. When in use, both assets need to be updated (ideally Stylized Water 2 first!)

    Changelog:
    Finally, have to confess that merely for every ~1000 licenses a new review is written. While these are greatly appreciated, they arguable represent a small minority of everyone using this asset in their project/games.

    If you’re familiar with the asset, please consider leaving a review here. These truly go a long way and greatly contribute to the longevity of the asset and will support future development.
     
    Stochfard, Lars-Steenhoff and Bwacky like this.
  16. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,510
    Just gave you a review, I must admit I had forgotten to do it and its such a great asset it deserves all the good reviews it can get.

    Also have to say that I'm really looking forward to the Dynamic Effects extension !
    That is on top of my list already.
     
    Bwacky likes this.
  17. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    192


    Amazing update, dropped a review as well.
    While at it, had a question since I've recently played around with most of the popular water systems on the asset store (Crest, bits of KWS, RAM to name the best only).

    #QUESTION 1

    Disregarding RAM which has its own custom spline system, I see a small shift in water systems going toward using Unity splines to produce rivers and lakes since 2022 has now splines built into the Engine pretty much. Microverse is also coming out with a roads module soon that I imagine will be definitely able to be repurposed into drawing river splines. Any hopes for SWS2 incorporating unity splines and its own river solution? Would be pretty fun to have that work with SWS outta the box. You can now instantiate meshes alongside splines. I imagine instantiating a plane and turning that into a river or lake mesh for SWS2 wouldn't be out of the question? :)



    # QUESTION 2

    Both aforementioned water systems have those fancy water zones/boxes drawn top-down, somewhat projected under the river mesh that you can enter for underwater effects. It's everywhere you draw the water and looks/works amazingly well. Any way to get something like that with the underwater module going?


    # QUESTION 3

    Both Crest & KWS have working underwater effects locally alongside custom fog solutions I tested (Cozy Fog, Boxo's Atmospheric, Fog & Mist 2, Enviro etc.). Do you perhaps plan to have the underwater effect package work alongside 3rd party fog solutions out of the box at some point?
     
    Lars-Steenhoff likes this.
  18. fullerfusion

    fullerfusion

    Joined:
    Dec 2, 2018
    Posts:
    22
    Hi Staggart,
    So, I'm having an issue when updating to the 1.5.0. The water asset is not loading up/not visible in the scenes or your demo scenes you've provided. I even opened a blank project and tried to open the Water Asset, but I'm still receiving the following errors in the consoles:

    • I'm currently on 2022.3.5f1LTS.
    • My Universal RP is 14.0.8
    I have tried right-clicking on the asset and Reimporting and it still did not work.
     

    Attached Files:

    Last edited: Aug 4, 2023
  19. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    192
    Had the same issue at first, but a project restart, a few reimports & some script edit > then save again fixed it.

    Check your StylizedWater_Standard.shader for the following lines:

    Code (CSharp):
    1.             #if UNITY_VERSION >= 202220          
    2.             #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
    3.             #endif
    Make sure they're fine looking like this. You can try to force a recompile, eg swap it to 202320, then back to 202220, save again. See if that helps.

    The ProbeVolumeVariants.hlsl is part of 2023, not 2022, but it seems the #if Unity_Version check simply doesn't trigger for it for whatever reason.
     
  20. fullerfusion

    fullerfusion

    Joined:
    Dec 2, 2018
    Posts:
    22
    The water asset loaded up correctly when I changed all occurrences to 202320
    Code (CSharp):
    1.  #if UNITY_VERSION >= 202320        
    2.             #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
    3.             #endif
    4.  

    However, when I tried to change it back to 20220 the water longer becomes visible. So, I'm not sure if I should keep it at 202320 or not?
     
  21. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    192
    Most likely something is stuck in your shader cache. I'd wipe the library folder and just restart the project to let it re-import, if you have the time and patience.
     
  22. fullerfusion

    fullerfusion

    Joined:
    Dec 2, 2018
    Posts:
    22
    Nope, even deleting the Library in my blank product did not do the trick.

    What fixed it on my end was I found the section that mentioned URP 15+ and I changed the #if UNITY_VERSION to 202320 and kept every other instance at 20220.

    Code (CSharp):
    1.             //URP 15+ (2023.1+)
    2.             #pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX
    3.  
    4.             //Unity defined keywords
    5.             #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
    6.             #pragma multi_compile _ SHADOWS_SHADOWMASK
    7.             //#pragma multi_compile _ DIRLIGHTMAP_COMBINED //Surface normals are animated, so pointless
    8.             #pragma multi_compile _ LIGHTMAP_ON
    9.             #pragma multi_compile _ DYNAMICLIGHTMAP_ON
    10.             #if UNITY_VERSION >= 202320          
    11.             #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
    12.             #endif
     
    Lars-Steenhoff likes this.
  23. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Thank you, that's certainly appreciated!

    This update also laid some groundwork to continue development on the Dynamic Effects extension :)

    Thank you! :)

    Now that there's a native spline tool, tools to create water geometry are indeed in my project pool! I had made a river spline tool a few years ago but saw little point in turning this into a public asset if it couldn't also be used to carve terrains and spawn river bed objects. Since everyone can now use the same spline system it's more straightforward to just focus on one aspect. I imagine Microverse could use the same spline and carve the terrain for example.

    Time permitting, I'd like to publish a tool to create lake geometry. With support for shoreline skirts (good for vertex color baking) and holes:
    upload_2023-8-5_10-49-45.png
    The same spline is ideally in place to stamp itself into the terrain and paint it as well.

    Additionally, a waterfall modeling tool, which makes it easy to create them right in the environment. This is turn can also follow a spline (as seen above)
    upload_2023-8-5_10-59-2.png

    River geometry I haven't ported yet but Unity's spline API is surprisingly similar to my own, making stuff simple to port over.

    Undecided if these will be 3 separate assets, or bundled into one. They can practically be used with any shader, but the vertex color functionality will pair nicely with Stylized Water 2.

    Always inspired by this scene, which requires meticulously crafted geometry


    About Underwater Rendering, what I outlined in this post still holds true. A (conceptually) alternative method would involve rendering water volumes (similar to the Diorama demo scene) and using that information in something like an intersection effect:
    upload_2023-8-5_12-4-47.png
    That would make the effect work for anything from cylinders (water tanks) to rivers.

    Volume being regular scene objects, they could render before (on top of) other objects such as those that Cozy or AHF create. That is really the issue, not being able to render them before the underwater rendering post effect.

    But to be frank, between moderate sales and ratings its difficult to justify dedicating the required time for such a fundamental rework. Other projects and features warrant higher priority. Currently, Underwater Rendering works fine with 3rd party post effects by simply making sure their render feature executed first. For Cozy/AFH, underwater rendering needs to be integrated into their shaders through the (now included) ASE shader node.
     
    adamgolden, Lars-Steenhoff and Bwacky like this.
  24. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Apologies, that's definitely an unintentional error. The code indeed belongs to Unity 2023.1+.

    I have pushed a quick fix yesterday, which can be pulled in by redownloading the asset from the package manager.
     
    Bwacky likes this.
  25. Osteel

    Osteel

    Joined:
    Jan 17, 2014
    Posts:
    59
    Hi!

    I'm receiving a shader error with the updated asset (I've used it before without issue). Hoping to get some idea how to resolve it. :)

    I've cleared my library (reimported the project), and verified up to date packages for URP and Stylized Water. I've also cleared and recompiled via the screenshot below.


    Stylized Water 2: v1.5.0
    Unity version: 2022.2.1f1
    URP version: 14.0.4
    Platform: StandaloneWindows64
    Scripting backend: Mono2x
    Color space: Gamma
    Graphics API(s): (Auto:True) Direct3D11
    Active VR plugin(s):
    First available fog integration: Default Unity
    Underwater Rendering installed: False
    Dynamic Effects installed: False
    Depth texture option disabled (anywhere): True
    Opaque texture option disabled (anywhere): True
    Async shader compilation: True
    Caching Shader Preprocessor: True
    Strict shader variant matching: False



    upload_2023-8-6_23-48-31.png
     
  26. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Thanks for the details!

    As it turns out, this "DOTS.HLSL" shader library is specific to URP version 14.0.7+, which is only available starting from Unity 2022.2.15f1.

    Updating to any version newer than that will resolve the error in a jiffy. Consider using the LTS version.
     
  27. Osteel

    Osteel

    Joined:
    Jan 17, 2014
    Posts:
    59
    Ah thanks for the reply! This being a client project, we haven't updated since we started but now we have good reason.
     
  28. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Understandable! You can also remove or comment out the line (205) in the shader file. That would be perfectly safe in this case.
     
    Osteel likes this.
  29. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    322
    I have a problem.... Some objects on the water disappear at certain camera angles.

    upload_2023-8-7_15-44-10.png


    Os it appears "behind" the water, which does not make sense.

    upload_2023-8-7_15-47-53.png



    Does anyone have any suggestions as to what might be causing this and how to resolve it? It only happens to objects that are in the water.
     

    Attached Files:

    Last edited: Aug 7, 2023
  30. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    322
    An Update - Changing the Materials from Transparent to Opaque with Alpha Clipping seems to have solved all the problems.
     
  31. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    What you're seeing is transparency sorting at work, a normal aspect of 3D rendering. Some more details can be found here (first item): https://staggart.xyz/unity/stylized-water-2/sws-2-docs/?section=troubleshooting-10

    Using Alpha Clipping for vegetation materials is conventional so would be recommended either way :)
     
  32. kjorrt

    kjorrt

    Joined:
    Nov 26, 2014
    Posts:
    34
    Edit: I figured out my problem.

    Are you going to release the lake tool? I'm creating floating islands and such a tool would be perfect for my game. Ignore the yellow line.

     
    Last edited: Aug 8, 2023
  33. afavar

    afavar

    Joined:
    Jul 17, 2013
    Posts:
    65
    Hello there, this is one of my favourite assets which changes the feel and look of a game instantly. I have couple questions that I need help with.

    1. Swimming
    I have a custom character controller to contorl my first person character. If I can detect whether I am in water or not, I can change some controls as long with the animations to have the swimming effect. The question is, how should I detect if my character is in water or not by using a water grid object? Should I just add colliders to all tiles and do OnTrigger check? Also I am open to any other suggestions that I can handle swimming.

    2. Shores at Night
    The color adjusted from the depth look great when it is day time, however, it looks a bit weird when it is dark. Any suggestions regarding on how should I handle this?

    DAY:
    upload_2023-8-8_16-3-32.png
    NIGHT:
    upload_2023-8-8_16-5-14.png
     
  34. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Seems like a prime candidate given this context indeed!

    I hope things go well enough to make it as far as an asset store release. If you go without any documentation and potential bugs feel free to send me a DM and I'll wrap up the tool.

    For such detection logic using physics triggers is indeed the most straightforward. Especially if the water is relatively flat. For something like an ocean, you'd want more accuracy and would use the Buoyancy API to fetch the water's height below the player, to see if it is submerged or not (even if slightly).

    You are right to think the water looks off at night. Based on your screenshots, I get the impression the Opaque Texture option is disabled in your pipeline settings. When this is disabled, it makes the underwater surface comes out gray
    upload_2023-8-9_16-36-20.png
    Top is disabled, bottom is enabled.

    If so, there's a notification and quick-fix button in the material UI
    upload_2023-8-9_16-38-16.png
     
  35. elpatrongames69

    elpatrongames69

    Joined:
    Mar 2, 2023
    Posts:
    91
    Does the underwater effect work on mobile?
     
  36. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    While it technically does, it is not supported.

    Even with all bells and whistles disabled performance will be at a critical point, not leaving much room for other things. I've observed this on Quest 2 and a Samsung S21.

    It can be pinpointed to the effect requiring a full-screen buffer copy, which taxes the available GPU bandwidth. This is fairly common on low-end/mobile hardware.
     
    elpatrongames69 likes this.
  37. kjorrt

    kjorrt

    Joined:
    Nov 26, 2014
    Posts:
    34
    Wow, thanks for the offer. I'm keen to try it out bugs or not. I'll DM you.
     
  38. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    241
    What does it look like under water?
    What about shallow versus deeper water?
    What about when the camera goes from above to below water? Is that supported?

    edit: ah I see underwater is a topic above. I'll read up on it first..
    edit 2: lol, put me on the interest list as well. My game is targeting iOS + tvOS though. Not sure if those platforms will be powerful enough anyway.. I tried Crest ocean, but it has bugs on iOS.
     
  39. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Preview of the WIP river geometry tool (separate asset), or at least one created using it. It indeed works swimmingly with Microverse, where the river can be created alongside of an existing spline path that carves and paints the terrain.



    Some notable features added over previous iterations are noise-based displacement to simulate the water flowing over heavy sediment or rocks. And a curvature optimization, where no additional edge loops are created for relatively straight sections.

    upload_2023-8-15_17-34-32.png

    To reach a the minimum viable product, a few minor bugs have to be addressed, and functionality needs to be added to control opacity, width and displacement over the spline
     
    adamgolden, Bwacky and Acissathar like this.
  40. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    How does it work with combining together rivers? A few tools I've tried work fine when it's one spline into another, but combining "mid" spline is generally a problem, is that also the same with yours? (Or maybe I've just been using them wrong lol)

    For example, blue is one river, green is a split that then rejoins:

    upload_2023-8-15_10-10-30.png

    Does it also by default generate the vertex colors to work with SW2, or does that need to be manually painted on the generated mesh?
     
  41. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    192
    Had no issues with LVE/RAM 2023 so far, KWS also does not produce difficulty in connecting splits as the water just sort of fits itself no matter where it is and always looks good if on the same Y level. How it's done is flying over my head though.



    Amazing work, can't wait to get my hands on it :D

    Hope sales improve to the point we can someday get that finite water body/mesh support addon as well.
    I've been playing a bit more with KWS recently and it's literally the 1 feature I'm missing in all other water frameworks, but the toolkit itself is nowhere close to the customizability and beautiful visuals SWS2 offers (and it's buggy as heck on URP, at least in my experience so far).
    You really have a one-of-a-kind water solution for NPR games out here with nothing even coming close so far.


    EDIT: Forgot to ask this before but is anything like SSR on the roadmap? Planar reflections are a bit overkill nowadays, rendering the scene twice destroys FPS like it's nothing in open-world scenes, and from what I was told SSR is almost free :rolleyes:
     
  42. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Unity's spline tool supports creating multiple splines within one "container" (as they call it). Splitting a spline at a specific knot would be possible. Not sure if attaching one spline to the other is straightforward, but at worst it means having to adjust one spline after modifying the other.

    For the intersections I'll likely settle for alpha blending, as to avoid obvious UV seams or needing to rely on flow maps. This already works well with blending a river into another body of water such as lake. A crude example:
    upload_2023-8-16_13-2-39.png

    When the mesh is being generated, it is ideal to store data in the vertex colors along the way. In the example I showed earlier, perlin noise is repeated over the surface and stored in the vertex colors, which in turn adds surface foam.

    Hopefully! I had previously done some R&D on implementing a "projected grid" technique, which aligns a water plane in the camera's frustum, creating water as far as it can see:
    upload_2023-8-16_13-27-30.png
    Source: https://fileadmin.cs.lth.se/graphics/theses/projects/projgrid/projgrid-lq.pdf

    Something that can easily be used today is the Boat Attack project's ocean mesh, which is a pre-computed mesh with gradually decreasing vertex density (see attached package)
    upload_2023-8-16_13-43-5.png

    SSR also falls under R&D, I had ported the feature from HDRP with some success, but inherent to the effect is the need for optimizations such as temporal reprojection for which I need to develop a better understanding. It is 'free' on the CPU side since it is GPU-based, come with a distinct set of limitations but is definitely an industry standard that looks great!
     

    Attached Files:

    Bwacky and Acissathar like this.
  43. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Submitted version 1.5.1, which focuses on addressing a few recently reported issues

    Changelog:
     
  44. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,045
    Hi Just bought the SW2 and the UWE and noticed that you stated

    • Can't mask underwater (eg. submarine windows)

    but I also noticed you had in your change log



    So is this a case of the docs should be updated now?, it may work in the future with further work? or it will never work?

    Thanks
     
  45. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    The information is still accurate :) Something like windows in a submarine or the glass of a fish tanks involves a different technique/design.

    I believe using a Render Objects render feature to render everything related to a submarine would work, as this would render it all on top of everything else. Though you won't see the kind of half-underwater separation on the windows or anything of the sorts.
     
  46. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    583
    Hi

    Since I am testing stuff on 2023.1, just for future info :), the water throws error with the new light probe volume system

    upload_2023-8-28_16-33-28.png

    It happens on all rendering paths (forward, forward+, deferred).

    Nothing for urgent fix, it just something i noticed when testing stuff on 2023.1 ;)
     
  47. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,209
    Thanks for the headsup! That indeed appears to be the case, I've taken note of it to investigate a fix :)
     
  48. alex_1302

    alex_1302

    Joined:
    Aug 20, 2019
    Posts:
    54
    Hi. I have a question:
    ¿Does some body know an spline tool that works correctly with the river mode? Ideally a free tool, but if there's no free a commercial tool. Thanks
     
  49. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    192
    No idea about free - only commercial I know it works with is River Auto Material. Hopefully that won't be the case much longer though :D
     
  50. alex_1302

    alex_1302

    Joined:
    Aug 20, 2019
    Posts:
    54
    Thanks for the reply. I did keep hopes there was a free spline tool. or another option.