How can i model a glass with two liquids in it?

Hi everyone.
I’m looking for some tips on how to model a glass filled with two liquinds with two different density like, for example, water and oil.
Thank you very much!

I think you need to be more specific. What look are you after exactly?

This:

Or rather this:

Hi Ikari!
Thank you for your quick reply!!!
The one i am looking for is the first one. Exactally the first one.
Can you help me, giving me some tips on which values, textures, node and so on i should use?
Thank you very much!!!

P.s. I am using Blender 2.70a.

do you want to use blender internal renderer or cycles?

If you use the skills learned in Andrew prices beer tutorial you should be able to create exactly what you want.

Just incase they dont know where to find that tutorial here’s the link to it http://www.blenderguru.com/videos/how-to-make-a-beer/.

Actually, i saw the tutorial, but i haven’t finished, in seeing it.
But, i understood that from this tutorial you will add a liquid layer, and then the foam.
However, i reached a good level of “glass”. But the problem start when i have to give to the two liquids in it the vaules to z transparency feature. I really don’t have any idea on how to do.
Also with the lights position, and so on.
Plus, i would like to not to use Cycles.
Thank you again!

if you use ray tracing as the transparancy calculation you can give the materials different index of refractions (IOR) which you can find on the web, i think glass is 1 water is 1.25 and oil I looked up just now was 1.47. alpha controls the amount of transparancy to the material 1 is opaque 0 is completely gone so somewhere around 0.1 to 0.3 but play around with it until you find a value you like, also take alook at this article on adaptive samples http://adaptivesamples.com/2013/10/19/fluid-in-a-glass/ i think this method makes more sense to use although I will admit i’m having a bit of problem right now with the oil material, another thing to do is in the shadow options click recieve transparant on anything that will recieve shadows by your glass and liquids otherwise it will be a dark shadow instead of a light gray as it should be. Hopefully this helps atleast a little.

Thank you for this quick review on reflective indices and the quick guide.
As soon as possible i’ll try to model my glass. And i’ll pubblicate it.
However, if someone else wants to join (CTRL+J) (:-D) this thread, with other tips, I cannot ask for better.
Bye

As Samuraishi said, Z transparency will not create the desired effect: Raytraced transparency + IOR values are the way to go. But are you sure you don’t want to use Cycles? Cycles is the future and the results will most likely be more realistic (and faster rendering)…


arent those two images exactly the same?
if they rest


Hi guys.
I did it!!! Thank you for all your support.
But, i think i need a little more of it. Why my rendering is not clean as yours?
I mean, why, on my glasses and scene there are those black spots?
Can you help me?


Here we go.
I simply messed up with samples.
Thank you again!
Bye!