PDA

View Full Version : Liquid density shading.


BobVelocity
06-14-2009, 06:14 PM
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?

Domain101
06-15-2009, 02:38 AM
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.

noouch
06-15-2009, 10:02 AM
If you can use Mental Ray, the Dielectric Material does a nice job.

cbamber85
06-15-2009, 10:15 AM
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.

BobVelocity
06-15-2009, 02:08 PM
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?

cbamber85
06-15-2009, 09:54 PM
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.

BobVelocity
06-16-2009, 08:25 AM
Cheers mate. I'll give it a go.

CGTalk Moderation
06-16-2009, 08:25 AM
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.