Perfect Cup of Coffee


#1

I’m having a rough time “nailing” a decent coffee material for a personal scene. Sure, it’s brown. Sure, it’s liquidy. But staring at coffee all the time in real life, and drinking it obviously, doesn’t help me with a decent coffee shader. I’ve tried ramps, phongs, mia_material_xs, and everything I could think of but still not getting far… Using mental ray this time.

Here’s a render without any GI I’ve been using as a starting point. Just focusing on the coffee material itself, and I’ll worry about some steam and bubbles later.

Any thoughts, or successful material setups to make The Bean?


#2

The simplest things are always the hardest. First off are you trying to replicate straight black coffee or coffee with milk. First thing I notice is that the coffee isnt dark enough and maybe not saturated enough. I would try using the mia_x with a max distance in the advance refraction tab. I dont personally don’t suggest having a glass cup I think maybe a porcelain type material would fit nice. But if you stick with the glass cup with the correct refraction can be tricky. I would take a look in the mia_x help doc, they have overview of creating a liquid to glass interaction with the mia_x.


#3

Also you are going to want to add a little lip to the top surface of your liquid. you will see this with liquids in real life, it will also so give you realistic reflections along the edge of the liquid.

Here’s a test scene i did real quick. The most important factor I think is using the max distance in the advance reflection parameter. Your light setup and your reflections play an important role too. If you want to give me your email I’ll send you the scene file.


#4

It would be grate if you post this file here:)
I`m interesting what parameters make the fluid to looks deep, getting darker witth distance.


#5

@Infernal
I have real italian espresso coffee with a cream on the up!


#6

and a texture for the top here:

http://area.autodesk.com/downloads/textures?tf=4&where=1&material=55


#7

that shader looks great with the ceramic but isn’t he going to need something like a dielectric interface to account for the contact of the two meshes? I haven’t done something like this myself but I thought I read about that. The caustics might go wonky otherwise. I dread the day I have to deal with liquid next to glass.


#8

I appreciate all your input, especially on something that should be so simple as coffee!

What’s key here for my scene is that the coffee shader works properly with the sun/sky nodes. I know it’s not great lighting in this test scene, but if it won’t work here, it certainly won’t in my main scene.

TaKIKO, yours is brilliant and a gorgeous render! I just need to do that inside a glass coffee cup, which is being a big pain. I’ve read the help docs extensively but am still having some issues. Here’s my latest render, which incorporates the surface tension rim as well:

I’m having a rough time with the glass refraction silliness, even with all ray depths set at 10 throughout (except for FG depth, obviously). But my coffee shader itself still sucks. I’m looking at a real cup of coffee, in a glass mug, right now on my desk. My Maya-coffee sucks, so I switched to a ceramic mug real quick to tuning the coffee shader specifically using Max distance and the mia_x:

Getting closer, but I still can’t get my coffee “black”. Using gamma correct nodes on all my color swatches too, except for the ceramic, which is pretty basic obviously. The wood texture is just to check reflections/refractions, I know it’s low-res.

ytsejam1976 @Infernal
I have real italian espresso coffee with a cream on the up!

If I hadn’t just slammed an entire pot of Cheap Black today, my mouth would be watering!

that shader looks great with the ceramic but isn’t he going to need something like a dielectric interface to account for the contact of the two meshes? I haven’t done something like this myself but I thought I read about that. The caustics might go wonky otherwise. I dread the day I have to deal with liquid next to glass.

I believe the mia_x handles all the dielectrics already, but could be wrong? Also, I’m using a full piece of geometry in my scene, not just the top surface. Which isn’t making things any easier.

I’ve done wine in bottles and glasses before, and that turned out great. But this coffee is slayin’ me! I can’t get it dark enough, and can’t get any caustic photons to go through the coffee at all. There’s not a speck of brown or even yellow in my first render here from caustics, and looking at this glass mug on my desk there should be a LOT of caustics going on, especially in black coffee.

I’m not usually emotional about Maya-work, but this whole incident recalls me to my days a long time ago reading Death Metal Poetry…

Most depressing book I’ve ever read, and this coffee project is following the poetry closely! (grins)

Edit: after re-reading the help docs, I find that you need to make a third “air transition” shape between the glass and the coffee geometry… But I’m out of steam for now, and I’ll get back to this tomorrow… I imagine this is what CGbeige was talking about?


#9

hi infernalDarkness, is this coffee enough dark for you??

the scene:

http://usuarios.multimania.es/heteropterus/descargas/


#10

think there is a problem with the link?!?


#11

http://usuarios.multimania.es/heteropterus/descargas/

sorry, now you can acces to the page, the file: cofee.zip

sorry again, i had upload a wrong file, now it’s the correct one


#12

Thanks a lot for the file.

How did you achieve the transparent edge to the coffee in the first post?

Cheers,

Steve


#13

if you are asking for this effect (is the same coffee shader):

you must to activate “use max distance” under the advanced refraction tab,

a 0.045 max distance and a very dark redbrown color for the color at max distance


#14

Yep, that’s the effects.

Cheers


#15

I believe the mia_x handles all the dielectrics already, but could be wrong? Also, I’m using a full piece of geometry in my scene, not just the top surface. Which isn’t making things any easier.

Since there’s always going to be a gap, however small, between the liquid and the glass meshes, I would think that to get physically accurate results, you’d need to tell the photons not to refract like they are entering air after leaving the liquid and then entering glass and vice versa. You might be fine just skipping it but I would think that this would cause unnatural shadowing and refraction if you didn’t account for this dielectric interface. There’s a thread that goes into it here (I haven’t read it - just noticed them talking about dielectric interfaces and Maya/mental ray/Realflow):

http://www.realflowforum.com/view_topic.php?id=3849


#16

two more tests


#17

As tostao wayne showed using a max distance is the key.

Heres my glass to liquid interaction


#18

@TaKIKO: Seriously bad-ass. Did you do the whole ‘reversing normals’ and changing IOR for different surface thing? For example, one surface for liquid to air, another for liquid to glass and another for air to glass? Really nice, though. All mia_materials?

@tostao_wayne: Really nice work as well! Looks really cool with those bubbles on the top. :slight_smile:


#19

Yea I followed the help doc tutorial. Its 3 different pieces of geometry. I did a lot of r&d while working on one of my demo reel assets that had a glass to liquid interaction.


#20

looks great.