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 ![]()
Hey again ![]()
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,
K
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)
└
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.
agiledependablegrassspider
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.
Submitted v.1.0.4
Added:
- 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
Fixed:
- 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
Changed:
- 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.
Regards!
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 ![]()
Regards!
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.
Regards.
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.
