Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How Is the Fluid Renderer Constructed?
#2
(22-05-2019, 12:28 PM)Komsur Wrote: Hi,

I'm trying to work my way through the Fluid Renderer to build something similar with slightly more things to edit.

It seems that what's happening is it's taking the base material ("Fluid Material"), and adding the colour from the "Colour Material", but I can't see where that combination is happening. Any ideas?

Thanks.

Hi there,

There's a basic description of how it works internally here:
http://obi.virtualmethodstudio.com/tutor...ering.html

The combination you're referring to takes place in step 2: particle color (rgb) and thickness (a) are rendered to a full screen texture using the "Colour Material".

Each particle can have a different color, when rendering into this texture. The particle color is the result of multiplying the ObiParticleRenderer's "color" and the color value for that particle in the emitter's "colors" array. How the color of each particle is blended with the other particles depends on the Colour Material. Usual choices are multiplicative (FluidColorsBlend.shader) and alpha blended (FluidColorsOpaque.shader).

This color/thickness buffer is sampled in step 4, when rendering the final image (happens in FluidDielectric.shader).

The rendering pipeline is a bit involved (specially the ellipsoid rendering math, which is based on this article:https://tu-dresden.de/ing/informatik/smt/cgv/ressourcen/dateien/publikationen/2003/siewdc/ellipsoid.pdf). You can however use the methods in ObiEllipsoids.cginc as they are, you probably don't need to modify them at all.

let me know if I can be of further help.
Reply


Messages In This Thread
RE: How Is the Fluid Renderer Constructed? - by josemendez - 23-05-2019, 07:57 AM