A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by StaggartCreations, Nov 3, 2020.
Asset Store | Documentation
Not yet available, will be submitted for review today, but I need the thread URL ahead of time
Ok, unexpected, but it was approved in a mere 2 hours
If you own the "Stylized Water Shader" asset, you can get this for free until 2021, after which a 20% discount is available.
This thread can be used for feedback and suggestions (always welcome) and general support questions.
Beautiful I’m jumping on this. Any limitations vs regular SW?
Can I have multiple bodies of water without them sharing reflections ? (Having their own reflections)
Nothing beyond what's listed on the store page already
Reflections come from reflection probes (or the default skybox reflection). Planar/mirror reflections aren't in there, since I'm still figuring out the best approach, so will be added in a future update. One point of improvement will in fact be separate reflection renders. This wasn't possible before, mainly because of a design limitation.
Oh that’s wonderful. I can’t wait to get this update. Is there a time line ? Perhaps a Xmas gift hint hint
and SW2 is pretty as hell.
Sent you some messages on Discord. Tried this shader in my massive world today and ran into issues. Is there a page on this asset's limitations? I couldn't find one in the doc, and it's possible there is some configuration needed not mentioned in the docs for massive open worlds or maybe it's not compatible.
You can simply scale the object so that it fits the entire world. Though this will thin out the vertex density of the mesh quite drastically, if you want detailed wave animations it's important maintain a high vertex count relative to its size.
The amount of subdivision for a mesh can be configured in the mesh asset's inspector
But the mesh shouldn't exceed 100K vertices, otherwise is starts to becomes mangled.
You could create multiple objects, laid out in a grid. Or use a single (smaller) mesh, that follows the camera around on the XZ axis (if there is enough fog, the edge would be hidden). As long as the UV source under the General tab is set to "World XZ Projected" this'll work.
Though for the latter you will need the attached script. This ensures the mesh doesn't simply follow the camera, but snaps to a grid matching the vertices. Without this the waves will appear to "swim" over the water surface.
The mesh size and subdivions need to match that of the water mesh for this to work smoothly. It also needs to be a rectangle, rather than a circle/disk.
I wonder if it's a URP version issue. I'm running latest 2020.1, URP 8.2.0
Even at scale of 1,1,1 it looks black:
Ah, I misunderstood, I didn't release the black part was also part of the mesh. I checked in 8.2.0 but can't reproduce anything similar. Does the light direction influence it, or disabling the Lighting/Translucency features?
Seems fine when the Lighting enabled checkbox is unchecked (set to false).
(some of my vegetation doesn't appear at this distance due to draw distance)
Can you describe in more detail what the Lighting features do and how they are implemented? It's possible Lighting features conflict with other lighting / sky assets.
Ah, then the culprit lies somewhere there. When Lighting is enabled, the water is affected by directional/spot/point lights and ambient light. This is needed if you have dynamic lighting, so the water reacts accordingly to lighting changes. When disabled, it basically comes an Unlit material.
Are you using any third party lighting assets? If so, I can check if adding them reproduces the black artifacts.
I'm using Azure[Sky] Dynamic Sky as my sky solution. Can you check with that asset?
Note that I'm not using Skybox ambient lighting, but instead Color:
Many stylized games use Color for the less realistic look. Azure Dynamic Sky updates the color in realtime as time of day changes. Note that I've made the changes for the Azure fog you mentioned in the docs.
Gotcha! I can check again with Azure in the scene, hopefully that's the differentiating factor. Once I can reproduce it, I can track down which part of the shader is responsible and fix it. Though, I won't be able to get to this until next Tuesday.
Submitted v.1.0.2 with a few requests:
- Support for Boxophobic's Atmospheric Height Fog (can be enabled through the Help window)
- Shader now correctly takes the mesh's vertex normal into account, making it suitable for use with spheres and rivers
Verified compatibility with Wavemaker
Starting fleshing out an idea for water projectors, which can be used to inject specific details into the water, such as lilies, moss and debris. Next to being able to use trail and particle renderers as projectors, allowing things like boat wakes and swimming effects. Custom materials are also supported, so any custom shader effects can be projected (color only).
All still needs more work, but this'll be available as a separate extension down the line.
Submitted version 1.0.3, which adds planar reflections. Notable difference between the planar reflections from SW1:
It can now can apply to specific water mesh objects. So multiple reflection renders are now possible, making it more suitable for larger worlds @QbAnYtO
There is a static SetQuality function, which can globally enable/disable it, as well as modify the rendering scale. This is with graphics settings the player can set in mind.
Reflections are blended with the skybox reflections, so the water will retain its visible curvature rather than looking flat.
Unfortunately VR is not supported.
- Water Object script, as a general means of identifying and finding water meshes between systems, this is now attached to all prefabs
- Planar reflections renderer, enables mirror-like reflections from specific layers
- Buoyancy sample positions of Floating Transform can now be manipulated in the scene view
- Error when assigning material to Floating Transform component, or not being able to.
That’s beautiful man. But will you add support for multiple reflections into the original stylized shader?
Great asset, looks good and easy to use - Cheers for that!
I'm having trouble though, I cannot assign a Water Mat to my objects. I tried replicating exactly your demo scene, but it just refuses to change the value of the waterMat on the floatingTransform.
I can change the material of your demo objects though (I assume because they already have a valid value).
Thanks in advance,
Edit: I got around it by disabling the custom editor (comment the [CustomEditor(typeof(FloatingTransform))] line), assigning the variable, then reenable the custom editor.
Afraid not, this would require to restructure much of the code. With SW2 I was able to start from scratch and keep this limitation in mind in the new design.
Thanks for the headsup, glad it's to your liking!
I fixed this in version 1.0.3, which should be available shortly. I hadn't noticed before, since all my testing objects already had a material assigned.
In the upcoming update the component no longer requires a material reference, but rather a new "WaterObject" component. But updating to this new version will automatically assign it so you won't notice the difference
Hmm ok. I have another question but I will post it on the SW thread and not his one for organization purpose. See you over there
I'm struggling a little bit to understand the role of the Child transform and your recommendation in the documentation to change the transform the child object.
It seems like, the FloatingTransform component is writing the transform.up to normal, overriding any other rotation (ending up with my boat following my parent object, but not its rotation).
I've tried putting the FloatingTransform component onto the Parent (Where my controller move the transform) or onto the child (Model) to no avail.
Ideally, I would love your script to "protect" my rotation around the Y-axis the same way it protects the X and Z position.
Any recommendation of the ideal setup? (Maybe updating your demo with a controller on the boat would help a lot as well ! I've tried rotating the BoatParent around Y from the inspector, and end up with the same kind of problems...).
Thanks in advance,
Edit: Work around
Vector3 rotation = Quaternion.FromToRotation(Vector3.up, normal).eulerAngles;
rotation.y = this.transform.rotation.eulerAngles.y;
this.transform.rotation = Quaternion.Euler(rotation);
I'm sure it's a bit dirty
Yes this is a bit tricky, since the script sets the orientation of the transform, based on the wave's normal, this modifies all axis including the forward axis. So will overwrite forward direction as well.
So if you're looking to make a boat controller with steering, I'd recommend this setup:
- Parent (orientation/normal and position, where Y follows the wave height)
└ Child (rotation on virtual plane)
└ <Any objects that should align with the boat>
The "Child Transform" field is something you can assign, so the sample positions also rotate/scale with this transform. Otherwise they stay relative to the transform the Floating Transform script is attached to, which can't rotate.
Alternatively, you can use the StylizedWater2.Buoyancy.SampleWaves function, which returns the wave height and normal and use this in your boat controller's logic.
Preview of the particles being added to the asset in a future update. Designed around gameplay uses, such as collision effects, swimming, or entering/exiting the water.
Most are build from flipbook textures, and have a normal map included, so will react to lighting and appear to have a 3D shape.
Can you stop? Can you Just stop spoiling us so much? Lol! You got me bouncing between sc post effects, SF and SF2. Man these are great. Keep up the awesome work bro!
Quick Question: The Fantasy Adventure Environment Asset says it includes:
"▪ Legacy version of the Stylized Water Shader (URP installation features a reimagined version)"
Does that mean that if you buy Fantasy Adventure Environment, you get the free upgrade to Stylized Water 2 (URP) or does that need a separate purchase? I'm mostly interested in stylized water, but if it's included in the Fantasy Adventure Enviro then I would go with that.
Thank you for the clarification.
The FAE package contains its own separate water shader, but it is not nearly as extensive as this asset. So if you're specifically looking for water, I'd recommend to get Stylized Water 2 instead, since it's specifically focused on just that.
Another issue: The sample points on the FloatingTransform keep on disappearing on Play.
Thanks for the headsup, I've tracked down the issue and it's related to using the component on a prefab (specifically when editing it). I've corrected it and the changes are now properly saved. I've also forced the movement to disable when editing a prefab, since it gets in the way. This'll be included in the following update which I'll be able to submit this weekend.
Sorry for the inconvenience, I hadn't considered prefabs needed a more specific treatment.
Perfect. Thank you.
- CanTouchWater function to Buoyancy class: Checks if a position is below the maximum possible wave height. Can be used as a fast broad-phase check, before actually using the more expensive SampleWaves function
- Context menu option to Transform component to add Floating Transform component
- Error in material UI when no pipeline asset was assigned in Graphics Settings
- Floating Transform, sample points not being saved if object was a prefab
- Revised demo content
- Floating Transform no longer animates when editing a prefab using the component
- Minor UI improvements
The Stylized Water Shader asset is currently 50% off until December 4th, meaning you can get it and this asset as an upgrade for $10 now.
Hi! new user here.
I bought the old asset in this sale and got the new one for just U$10.. incredible value there. People should be running to buy this
So I have some questions about the URP water.
I configured my first "ocean" and went for a low poly look (flat shading), with some other niceties, trying to test most of the features at the same time:
I noticed refraction doesn't seem to work in low poly mode. Is that a known limitation?
At the same time caustics seems okay and distorted, when using the Distortion value in the shader.
Sure, is distortion at the level of the big flat polygons, but refraction seems to ignore even that.
Also, is possible to set very bright sparkles in low poly mode?
The intensity property (in the Normals tab of the shader) seems to change mostly the "size" of the effect, and there is no color property (thinking of setting an HDR color very bright, to be used with bloom).
Does the old asset have some textures or other things that we should install to use them with the new asset?
Also, do you plan to port most of the functionality of the old one? I'm thinking about gradient colors for the water, but I have no idea if it would be possible.
I have seen only one small bug.
When I add a Planar Reflection Renderer component to an empty object, I lose rendering in the editor, because an error in line 174 of PlanarReflectionRenderer.cs:
if (cameraData.renderType == CameraRenderType.Overlay) return;
It seems "cameraData" is undefined at that point for some reason.
If I comment that line I get back the rendering and I also get the reflections.
So I added a null check and all is good for now.
I'm working with Unity 2019.3.15f1, URP 7.4.3, Windows 7 64 bits if that helps.
Thank you for the feedback!
Right now, when using flat shading, the normal map is omitted entirely, which is also used for distorting the caustics and refraction. My reasoning was that this didn't fit with the flat shaded look. I've made some changes so the normal map is still used for these features, if it's undesirable, the distortion sliders can simply be set to 0, to the same effect. But at least with these changes, it'll be best of both worlds. I'll include this in the following update (1.0.5)
The sparkles intensity slider can go up to x10, which acts as multiplier for the sun color being used to color them. So if the bloom effect has a threshold of "1", any pixels brighter than that will start to bloom, so it's definitely possible to have them glow. One thing that's changed in 1.0.5 is that sparkles are no longer based on sun direction. This didn't work with dynamic lighting, causing the sparkles to shrink/expand in size based on the sun direction. Instead, they're a constant size and fade out when the sun reaches the horizon, something to keep in mind for now
I have an open branch which adds a gradient option, though this needs some more work as I'm aiming to save the gradient directly in the material, instead of a separate file.
As for the Y-rotation, please see this post for clarification.
I've added a null check to the Planar Reflection Renderer script. It seems a non-URP camera came into the mix, which is strange, but little effort to double check for such a case.
Hi, thanks for the answers.
I will wait for the next build to continue my experiments with refraction and sparkles
About the Y-rotation, it took me some time to understand it, but I got it in the end. Your transform child idea is already more flexible. I just got confused in the beginning and didn't understand that I have to put my mesh in the child.
Another question: do you know about the "Volumetric Fog & Mist 2" asset? (also for URP). I don't see it in your "third party integrations" notes, but maybe is because is also very new. Anyway I will try to integrate it soon, so I will tell you if I find any problems
I added a "sand" mesh at one of the borders of my scene and some flags moving with wind physics, and if I had a VR setup I swear I could just look at this scene with the sea and the waves all day. The only thing that I miss is that somehow the waves "painted" the sand with a darker color, and then did a slow fade out to the normal color.. so I'm just going to leave this idea here
If the documentation mentions anything about adding support to transparent shaders I'll be able to incorporate it, if so let me know. You'll notice things aren't looking properly if the water appears to ignore the fog and renders over it, which is where the integration comes in
Ok, more feedback.
I'm trying to setup a water material for my second use case: water flowing through a path.
From what I understand the main way of adding a direction to the water flow is changing the "Animation direction" in the "General" shader tab.
It also seems that some of the shader effects, like "Normals" and "Surface Foam" move a "layer" in this direction, but also a secondary layer in the opposite direction.
I think it would be nice if we could control the speed, direction and "intensity" of these secondary layers, for Normals and Surface Foam (maybe also "color" for foam).
For now my idea would be disabling some of these secondary layers sometimes, or moving them in the same direction as the primary layer, but at a slower speed.
At the start I tried setting "UV Source" to "World XZ projected".
This works good enough for water always in the same direction (even with changes in inclination, like cascades).
But if I want a more complex path with curves, it seems I would need a different material/mesh for every direction?, so is "Mesh UV" needed for that case?
My problem with "Mesh UV" is that it seems it doesn't use the mesh "inclination" to simulate things like cascades. So it would be nice if the mesh normals could be used to help with that.
Is it possible to create an ocean with this asset?
Thanks for the feedback! All the points you describe are exactly the reason why I have a "River mode" in my backlog for the asset. Right now the shader is geared towards flat water surfaces, but not splines. A river toggle would change some of the shader's behavior so it's more oriented towards flowing water. There's still a few things I'd like to finish first, so this'll come around some time in the future
There is a pre-made ocean prefab/material in the package. Though the asset is not an ocean simulator in itself, the waves functionality can only be stretched so far before tiling will be noticeable. So I'd say it's capable of water just under the threshold of oceanic water.
Maybe I did not express myself correctly, is it possible to make an endless/repeatable system?
I stretched it to 100x100 but the waves look ugly.
Ah, I see. Not presently, but an upcoming update adds a Water Grid component, which can create a number of water tiles and follow a specific transform around. This way it's not necessary to use a gigantic mesh, which would otherwise require millions of vertices.
Ahhh nice, that's cool. Thank you
Submitted v1.0.5. Changelog
- Particle effects, composed out of flipbooks with normal maps:
* Big splash
* Stationary ripples
* Collision effect (eg. boat bows)
* Splash ring (eg. footsteps)
* Waterfall mist
* Splash upwards
- Water Grid component, can create a grid of water objects and follow a specific transform.
- Material turning black if normal map was enabled, yet no normal map was assigned.
- Intersection texture was using mesh UV, even when UV source was set to "World XZ Projected".
- Waves no longer displace along the mesh's normal when "World XZ projected" UV is used, which was incorrect behaviour
- Sparkles are no longer based on sun direction, this way they stay a consistent size in dynamically lit scenes. Instead they fade out when the sun approaches the horizon.
- When using Flat Shading, refraction and caustics still use the normal map, instead of the flat face normals.
- Planar Reflections render scale now takes render scale configured in URP settings into account
- Improved Rough Waves and Sea Foam textures
Hi, I was playing with the last update.
I have to say that distortion and caustic look much nicer in low poly mode now.
Also sparkles are better and more useful in that mode.
If I had to add something to the sparkles, probably it would be some kind of randomness (or noise) to the effect,
so there is no hint of a "repeating tile" look over large areas (when looking at the sea from afar for example).
Something else that I noticed recently, is that when using refraction with any other shader option, always there seems to be a border of the real object (of white color in my case), that is visible underwater alongside the refraction distorted image.
Also, when using intersection foam, the effect doesn't seem to follow the refraction, but the real shape of the object under the water.
Don't know if this is expected.
I just upgraded to version 1.0.5, I am very satisfied with the result. Do you have any predictions about when you will work in the under water environment?
Glad to hear hear the changes are working out for you!
The sparkles are based off the normal map, so at some point tiling becomes noticeable. I have a tiling reduction feature for the normal map in my backlog (SW1 had this) so that'll likely circumvent this.
As for the refraction, this is unfortunately a side effect. The depth color is not being refracted, I had dabbled with this before, but it brought forth different discrepancies in the shading, so picked the lesser of two evils so to speak. Still a point for improvement I may revisit later.
I've actually been putting more work into this the past few days. The underwater shading is pretty straightforward, but determining what's above and under water is a challenge I'm still picking away at. What I'm going for is support for partially submerged camera's much like you'll see in AAA games. In many games the camera only snaps to either fully above the water, or under it, but it's 2020 so that's not going to cut it
Here is a mockup:
Everything disappears when the camera goes below the water right now. And I've added the blurred separation line in Photoshop. It looks way better with it, so I consider it a requirement to make that actually work!
The underwater rendering will be an extension asset though, given its complexity. As it would drive the price up otherwise, which isn't ideal for people that don't care for underwater rendering.
Underwater rendering, extension or not, would be awesome. Put me in the pre-order list for that
I don't understand completely the problem with the refraction, but would it be possible to specify some objects/materials to not render "under" water?, and see just the refraction?. Just forget about this if it doesn't make sense.
Put me in the pre-order list too
Small bug: The hole shader for cutting out a water area (e.g. in a boat) is not used by the Curved World integration. If the world is then curved, the clipping area remains in the normal position.
Would be super cool if this will be fixed in the next update. Until then, I wish you a Merry Christmas and a Happy New Year!
You're right, this flew under my rader, but can be easily remedied. I'll DM you the modified shader and will include the changes in next update
As already mentioned in my Assetstore Review, the support is outstanding! Thanks a million for the superfast fix!