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, Sep 8, 2016.
Hahaha You're right I confused it with another of your assets we're working with, I'm sorry
Is there a way to edit the shader so tree billboards intersect with the water?
I had this issue with another water shader and the developer did something that made the shader intersect. Im asking them about it too, but I thought I should ask here since you know the shader best.
Its great water by the way - very versatile and good performance.
Setting the render queue value on the water material to 2899 will likely fix this. With the default value of 3000, the water renders over tree billboards (assuming the ones created by the terrain system). These have a render queue value of 2900, so having the water render before them will result in correct sorting. On my end, the water then properly intersects with the billboard meshes.
Thank you I figured it out. I removed the alpha:fade from the shader and now it intersects with billboard trees.
I have another question.
How can I turn on and off the reflection by script. I was to do this in my options so people can choose.
stylizedWater.useReflection = true/false turns planar reflections on and off in the script attached to my water object. But it doesn't actually turn the reflections on and off in the water.
If I start the game with planar reflections on then this will turn it off, but not on again.
If I start the game with planar reflections off it won't turn them on or off (although the checkmark in the stylized water script goes on and off in all cases)
Would I have to make a operate water object with a. separate stylized water script with planar turned on and switch between them?
Glad to hear that works for you. I wasn't required to modify the shader, but who knows!
Settings the "enableReflection" bool value on the water component will enabled/disable the rendering. And disabling it sets the reflection strength on the material to 0, otherwise it shows a gray reflection (default texture color). But it doesn't set it back to what it was, when enabled.
So when you enable it again, you'll have to use StylizedWater.material.SetFloat("_ReflectionStrength", <value>); to set it back to whatever value it was. It's a little counter intuitive, since you'll have to save the desired reflection strength value somewhere beforehand, but it works
thank you for the billboards I use a huge water plane like 2000x2000 - maybe that's why my billboards don't intersect. Unity is like love - full of mystery
it's really wonderful water. I love diving and swimming in it - it feels so wet.
if I disable the reflection during run time do you know if there any kind of performance hit, compared to if I disable it from the start and never enable it?
Happy to hear you like it!
I don't think there will be a noticeable performance hit. But toggling reflections does involve the creating/destruction of an object and texture. But if the game is loading anyway, a fraction of a millisecond probably doesn't make a difference. Ideally, it would be disabled by default, and enabled when needed. But I don't think it's it would be causes for concern otherwise
Hello again. Would your asset be compatible with Overcloud?
I have no idea about shaders, so I would be unable to make it compatible.
Any news on the URP version? Will it be for mobile as well?
I don't Overloud myself, so can't exactly test it. But judging by that page, it should be possible to add support for it. This requires some minor modifications to the shader. You can do this by opening the StylizedWater_Desktop.shader file.
At line 66, add #include "Assets/OverCloud/OverCloudInclude.cginc" underneath it. Note that the file should actually be located there, if you've moved the Overcloud folder, adjust the file path to match the location in your project.
At line 360, replace:
c.rgb = staticSwitch857.rgb;
c.a = OpacityFinal814;
float4 finalRGBA = float4(staticSwitch857.rgb, OpacityFinal814);
OVERCLOUD_OCEAN_ADD(finalRGBA, ase_screenPosNorm, ase_worldPos.xyz);
c.rgb = finalRGBA.rgb;
c.a = finalRGBA.a;
With this in place, Overcloud's effect (I'm assuming volumetric lighting) will be drawn on the water surface correctly. Let me know if it throw's any errors
It's practically finished, except for some minor touch ups and polish. I'm currently down to screenshots and documentation, which is the final stretch! I decided to omit some of the advanced features (interactive water and underwater rendering) as separate extensions. Otherwise it just drives up the price, and takes much longer to finish.
Like the original package, it's also mobile compatible. On low end devices (OnePlus One and iPhone 6s), it runs at about 36fps with all features enabled. Disabling the advanced features, which aren't targeting mobile anyway, brings it up to 60fps+. On newer devices (Galaxy S10/Nintendo Switch), all features can be enabled, without noticing a performance hit.
It's a huge improvement over the current shader, since I'm not using a node-based shader editor, so was able to optimize it rigorously.
It would be amazing if your water would support ripples and splashes like this:
Is this the kinda thing you mean by interactive water? Those flow distortions/refractions are amazing
Yes, that's exactly what I meant
This technique uses particle systems. I made a prototype that uses this a few months ago, but it's fairly basic and difficult to translate full characters bodies and boats into ripples. The ripples also can't bounce off each other. What I'm looking to achieve is the same technique as used in AC Origins, Uncharted 4 and Fortnite (example). I've conceptually laid it out, but there's still a lot to figure out, so I'm leaving for it for a rainy day.
Well our money is sitting here for the taking, please do take it