Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I get fluid material from custom meshes (melting effect)
#2
Hi!

Not something we plan on doing anytime soon, as the renderer is specifically designed to render particles, and takes advantage of many assumptions that only hold true for particles. Using arbitrary meshes instead isn't as simple it sounds, there's several issues that complicate it:

The renderer assumes all particle geometry is collapsed into a single mesh composed of collapsed quads: a sort of point cloud. These points are then expanded  into camera-facing billboards in the vertex shader. This is for efficiency, as it allows to render thousands of particles without the need for GPU instancing, compute/geometry shaders, etc. Using arbitrary individual meshes would force the use of instancing, and a big part of the renderer and the shaders used for it would have to be modified/rewritten.

Also, a big part of how the fluid looks is transmission/absorption. This is calculated taking into account the thickness of each individual particle as seen from the camera's pov. Then, the individual thickness of each particle is rendered additively on the thickness buffer, and used to make the fluid appear darker in zones where it is thicker. Without absorption all you're left with is a plain opaque/refractive surface.

For ellipsoidal/spherical particles, thickness can be calculated analytically. For an arbitrary mesh however, it can't. You'd have to do it in two passes, rendering the depth of back faces of all objects with a "max" blending mode, then the front faces with a "min" blending mode, and subtracting both. This is significantly more complex that the approach used for particles.
Reply


Messages In This Thread
RE: How can I get fluid material from custom meshes (melting effect) - by josemendez - 08-05-2020, 03:02 PM