Liquid Shader for Unity
A downloadable asset pack
Buy Now$2.00 USD or more
This is a fluid shader for Unity URP settings. Also added the wobble effect script in case anyone want to do something with that.
Script originally created by MinionsArt:
https://minionsart.github.io/tutorials/
If you use script with the shader I created, I'd suggest setting Frequency and Amplitude around near 0.
Purchase
Buy Now$2.00 USD or more
In order to download this asset pack you must purchase it at or above the minimum price of $2 USD. You will get access to the following files:
FluidShader.unitypackage 23 kB
Download demo
Download
WobbleEffectExample.cs 1.6 kB
Comments
Log in with itch.io to leave a comment.
Hi :) I've just grabbed a copy of the shader, and am liking how much it solves for what I'm making! :) I had one minor question about an issue I'm having, where the "top" of the water seems to be invisible if there's an object behind it? It's almost like it can draw okay using the discard/skybox, but if there's any 3D, it draws that instead of the fancy water?
I've got an example screenshot, and was just wondering if this was something daft I've missed, or a quick thing you may have encountered before? :) I'm using bog-standard URP lit materials for the yellow plane and the bowl that the liquid is inside. :)
(I can also imagine it might be URP also thinking about it!) :)
Either way, the effect is neat, thank you for making it! :)
https://imgur.com/a/8XVv9MY
https://imgur.com/a/584ikIw this is the minimum I've replicated with - Making an empty project, installed Shader Graph and Universal RP, then making a default URP asset (assigned in project settings), making a blank material for a plane, adding a capsule with fluid on, and then playing around) :)
Hi, it's nice to see you liked it. Thank you.
As for your question, I didn't try it the way you did before but it's possible to see that result. In theory, since I created the material double-sided, it renders both faces but doesn't create geometry for the inside. If you create new material and make Render Face - Both, without using the shader, you probably will see the same result. (If I understood your problem right.)
To see more realistic results, you can do some research on fluid simulations.
For simulating fluids I have tried something before. Here's my repo for that. https://github.com/ereneker/Fluid-Simulation
Though I never done rendering part since I had to learn more about compute shaders that time. If you want to do something like that, I'd suggest you to watch Sebastian Lague on youtube.
I'm currently moving to a new place so won't be able to look at it for a couple days. Later, I might look into it and try to figure a way to do that with shader. I'll update the asset if I find something.