Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
white particles are rendered completely clear
#2
Hi there!

(11-07-2022, 08:50 AM)locque Wrote: It looks like the renderer adds color to fluids by two sets of little blobs spread throughout the fluid that can only be a very limited amount of primary colors and blend to approximate the color you actually want the fluid to be.

I'm not sure what you mean by "two sets of little blogs spread throughout the fluid". Do you mean particles? The fluid's volume gets its color from the color of the underlying fluid particles, which can be *any* color. This is used together with the fluid thickness and absorption at any given fragment to get the final color.

Quote:But instead of these blobs turning white for as you remove saturation and add lightness to the color, these colored blobs instead become more transparent until they fade away completely at FFFFFF leaving the fluid with no color of its own and only lighting, reflections, and refraction.

That's the expected behavior for any transparent, transmissive material: as the material absorbs less light, the light passing trough it gets less "tint" until it eventually passes trough untinted. For an object to appear white, it has to reflect light, not absorb it. Only an opaque material could become white.

Quote:The only way I can bring some of the white into the fluid is by lowering the transparency of the fluid renderer as seen in image 2

Yes, that's the correct way to do it: by making the fluid more opaque, "white" progressively shifts its meaning from "allow all light wavelengths to pass", which yields clear/transparent fluid to "reflect all wavelengths", which yields pure white.


Quote:which is not an option for what I'm trying to do since the white fluid needs to mix with other clear fluids, which means they need to be on the same renderer and same transparency setting. Is there any way to get something like image 4 from the renderer with transparency set to 1?

Nope, that's just impossible. You cannot simultaneously have a material be fully transparent and white. A material has to have some degree of opaqueness (that is, reflect some light) in order for it to have some color of its own, all a transmissive object can do is tint light (by absorbing certain wavelengths) as it passes trough it, but it cannot "add" wavelengths unless it's emissive, and it cannot reflect them unless it's opaque. You can try this yourself with a transparent material in Unity: make it white and fully transparent at the same time, you'll soon realize it's impossible. You need to lower transparency (alpha) for any color to be visible.

You might have some success by writing your own fluid shader or modifying the included one (/Obi/Resources/ObiMaterials/FluidShader.shader), as what you're trying to do doesn't seem to have any physical basis.
Reply


Messages In This Thread
RE: white particles are rendered completely clear - by josemendez - 11-07-2022, 10:27 AM