Friday, September 27, 2013

Maya Fluid - Losing color

If we use color method: dynamic grid to emit colored fluid (from a textured surface for eg.) the color of the fluid is getting grayer and grayer during the simulation. So we lose the emitted color sooner or later.

So what is going on in the background:
Since we use dynamic grid on color every voxel get an rgb value. It seems 0.4, 0.4, 0.4 is the default or something like that. We can check it like this: getFluidAttr -at color -xIndex 0 -yIndex 0 -zIndex 0. The simulation emits color with density but the remaining voxels (the empty ones: means no density) still has the default color. So during the simulation the emitted color is mixing with the default color and that means the fluid is turning to this default color gradually. There are two attributes in this context: Content Details / Color / Color Dissipation and Color Diffusion. Unfortunately the default value is 0 for both. So we can only increase the effect of loosing color.
Since there is no option to set no value on each voxel (it's not 0,0,0 bec. it means black) it is necessarily to lose the emitted color.
The only way to avoid gray color is to "overload" fluid color. We can emit color values like r:1 g: 5 b:2. Of course it is not an ultimate solution but works fine.

Tuesday, September 17, 2013