Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Foam Rendering suggestions
#3
(31-10-2024, 10:43 AM)josemendez Wrote: Hi,

Foam is not independently culled (it gets culled with the solver, if the solver's "simulate when invisible" is disabled).


Setting emitter.speed only sets the emission speed, existing fluid particles continue to live on until they reach their maximum lifetime. Foam continues being updated as long as foam particles still exist, it does not care about fluid particle lifetime or emitter's emission speed at all. The foam simulation and the fluid simulation are completely independent from each other, so setting emitter.speed = 0 will not affect foam behavior at all.

My guess is that your foam's "atmospheric drag" value is set to 1?. This will cause fluid particles to immediately lose all energy when no nearby fluid is around, making foam unnaturally stay frozen midair. Typically you're have a small drag value to simulate atmospheric density, allowing foam to slowly fall due to gravity when no fluid is close to it. It can also age faster, using the "air aging" parameter so that foam vanishes faster mid-air, when no fluid is around. This should result in natural-looking airborne foam.


Setting the shader's render queue and/or render type to Opaque does not make the shader opaque, it just changes the point during the frame at which the object is rendered. It does not change what the actual shader does at all. You need to change the blending mode too, write to the depth buffer, and add proper lighting which may not be trivial at all if you want it to integrate with KWS's custom lighting.

Unfortunately, the foam shader cannot currently be made using ShaderGraph. You'll have to edit the shader as plain text.

kind regards,

Hi, thanks for the reply. But as I just test, no need to use script, you can test by change the speed to 50, wait a few secs, then 0, by changing value in the inspector. the foam particles will stay frozen in place after all the fluid particles die out. I've test this with various foam's atmospheric drag value from 0, 0.1, 0.5, 1 all same result. So, it's hard to say it is not independent on the emitter.speed, or I may say fluid particle count. As the frozen effect only happens when all fluid particles had died. Pls check it when you have time, thanks again!
Reply


Messages In This Thread
Foam Rendering suggestions - by spikebor - 26-10-2024, 05:57 PM
RE: Foam Rendering suggestions - by josemendez - 31-10-2024, 10:43 AM
RE: Foam Rendering suggestions - by spikebor - 01-11-2024, 07:01 AM
RE: Foam Rendering suggestions - by josemendez - 04-11-2024, 09:05 AM
RE: Foam Rendering suggestions - by spikebor - 05-11-2024, 10:11 AM