Liquid density shading.


Hello there peeps. I’m shading a bunch of meshes from realflow in maya to look like cola.
Now, I can get a pretty good representation with either phongs ramps and sampler info or the mia. But my problem is cola has a property where it changes colour based on thickness and density. Facing ratio just doesn’t cut it on the move. Has anyone got any ideas on controlling the colour based on thickness of the mesh?


You’ll need to use a volumetric shader to get the effect you’re looking for. If you’re using Maya’s renderer, try Particle Cloud as a starting point. You’ll want to enable raytracing for the best possible look, but rendering times will be expensive.


If you can use Mental Ray, the Dielectric Material does a nice job.


Agreed, the Architectural Guide for MR at the bottom of the page for the mia_material has section on coloured glass, it’s what you’re after.


Thanks for your responses but it’s not glass it’s the liquid I’m shading. This is a realflow mesh which constantly changes shape and density. I need to have control of the colour at certain thicknesses of the mesh. Applying multiple colours to the dialectric material would be ideal if anyone knows how to do this?


Yeah we know, the glass example used in the guide is just that, an example. The dialectric shader does not have any capability of adjusting the colour of the material according to thickness, so you’ll need to use an mia_material. In the Advanced Reflection rollout there’s a ‘Colour At Max Distance’ attribute, stick a ramp map in here. I don’t know if this works, I haven’t tried it, but I can’t see why it wouldn’t as you have to specify a max in world units so there isn’t a problem with infinity. Remember to set your shadow algorithm to segments, otherwise it’ll look horrible.


Cheers mate. I’ll give it a go.


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.