#How do i add foam where the water meets objects like terrain?
1 messages · Page 1 of 1 (latest)
Basically look up almost any water/sea shader tutorial. In fact, since it's hdrp, the built-in water shader should already have it.
it doesnt unfortunatelly i checked everything in the water component
Really? Why would they have a whole section in the documentation dedicated to it then? 😅
https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@17.0/manual/water-foam-in-the-water-system.html
Unfortunately none of it is contact foam u gotta do it with decals which is not dynamic
I mean, you could probably do it dynamically via code, but I see what you mean. Perhaps look up some open source water/sea shaders. Something that should be pretty easy by reading the depth buffer.
pathetic that i have to reside to a 3rd party asset for that
Well, go a few years back and there was no water feature at all. To be honest, it's not really an engine feature and you need to implement it yourself IMHO.
im against the logic that engines should provide the bare minimum, its not how technology/business works
Unity provides what, a dozen water solutions across their various examples, for the multiple rendering paths and build targets and styles? It isn't some one size fits all sort of thing.
doesnt hdrp have a specific water solution? i studied the foam examples, theres one that does what i want but i couldnt find how it dynamically fits the shape. unless it uses a premade foam mask i missed
Probably the fault of Terrain being outdated and not really worth investing in, since shore foam would require cooperation of the type of terrain tech used
Or it'd require a dedicated top down depth buffer which isn't very scalable
Unless it was really complex
I mean, you're free to not use unity. Perhaps unreal engine provides a built-in solution. Support the competitor and unity might think of improving in that area. 🤷♂️
Im using unity cause i like the freedom but there should be a balance. I mean they implement water in hdrp which looks great why not finish the job with the foam
I guess decals and wind based foam was finished enough for them.
I'm wandering what's the foam in this screenshot though
Wind driven I guess.
But thinking about it, still water doesn't really produce foam in real life.
Unless you add soap or some other substance to it.
For example
Or basically most lake photos
Open the scene and check?
In fact, "contact foam" is not even a real word/phrase. You just came up with it.
The only place on the internet that actually mentions "contact foam" in computer graphics is, ironically, a post about unity water. In which there is actually an answer to your question.
https://discussions.unity.com/t/unity-6-hdrp-water-shorelines-contactfoam/1599006/2
If the masks are procedurally generated by the shader and not pre-existing assets i may be able to use it
When the water has motion and hits something solid it mixes with air and creates foam thats what im tryna do
That's what the wind foam is for.
Though I guess there would be some foam remaining for a while after the motion.
Dont think wind foam works with other gameobjects its just an effect on the whole water body
Indeed. Did the forum post not provide you an answer though?
It does ill try it and update thanks!
The description of that image in the manual is that each of those masks is generated by decals.
Generated by decals? Arent decals just projectors of textures?
The decals project the mask onto the water surface