Rendering clear glass + liquid -- AAARGH!

Hi y’all,

I’m currently working on a project which would show an hourglass with colored water dripping down. I haven’t even reached the part where the FluidSim kicks in, and I’m already pulling my hair out over the rendering of just the hourglass + liquid…

Here is the .blend file so you can have an idea of what I’m talking about.

I have tried to render with three different engines: BI, Yafray and Indigo, and I’m not at all satisfied with the results. Rendering with Indigo was purely out of curiosity anyway, as I plan to animate the fluid and I don’t intend on having my computer tied up for a year to render some 250 frames.

The problem I encounter is twofold…

First, I can’t seem to get properly transparent glass and/or liquid. I searched the Internet and found this came from the RayDepth setting which wasn’t high enough. I did crank it up but it resulted in CRAZY render times (something like 4 hours for ONE still with BI…) If it takes that long, I don’t really see the point of NOT using an photorealistic unbiased renderer (such as Indigo…) Because even with such lengthy render times, it still doesn’t look good (here is a previous version rendered with BI, which is nowhere close to photorealistic: Yafray doesn’t even correctly render: the liquid seems to fill the whole bottom part of the hourglass (it acts like the glass’s refraction index is way off the mark; it looks like solid glass with a red thing inside rather than hollow glass with liquid inside.)

My second problem was that, after adding a ground plane (which I removed in this version of the .blend file), I didn’t get any caustics, but an opaque shadow, which is very unlikely. I checked out the Yafray Caustics tutorial, and tried rendering with the indicating GI settings. I waited another 4 hours (!) only to find that there were no caustics whatsoever and, what’s more, the liquid did not render at all (most likely because I hadn’t cranked up the Yafray panel’s RayDepth setting, only the Depth and CDepth in the GI panel…) Plus they mention Photon lamps and whatnot, and I don’t understand a thing to all their gibberish. Clearly not noob-accessible!

I’m growing quite desperate here, so any kind of help would be most welcome… My computer does not seem so outdated to me (Core2Duo 3 GHz with 2 GB RAM) and I can’t seem to be able to render those damn three objects correctly in an acceptable amount of time. I’m very new to Blender and CG in general, and am well aware that rendering glass and liquids in the first place is definitely not the easiest thing, but I know that I can reuse the hourglass thing for a project with my students next year, so I figured it would be nicer to work on some concrete project, and not waste time on random tests.

To finish, if there is no way to render the scene satisfactorily with BI or Rafray, I’d be prepared to render with Indigo (maybe I can get the network administrator @ school to turn the computer room into a render farm for me, during vacation for example…) but then again, I run into some similar rendering problems: the liquid does not show through the glass when I render (the body of the hourglass is simply gray and opaque). I followed every modelling directions (liquid overlapping the glass before spinning the curve, modelling meniscus and what have you) and material instructions from the Indigo documentation, even tried to crank up the Max Depth and Max. num. consec. reject settings, took care to assign a greater precedence to the glass material than to the liquid, because glass displaces water, etc. Still, it won’t work.

I know I’m doing something (very possibly MANY things) wrong, but I’m kinda stuck in place.

Any help would be greatly appreciated. Thanks,

Ari ;o)

from what i understand, and the following page, Ray Depth is the BU depth of your object, not some setting where larger values make better renders. The only More-is-Better setting I know of in Ray tracing is the number of reflections setting.

First, put something behind it so you can see the refraction and reflections and you can see what is really off about it.

Here is the render with BI (about one hour render time…) with a sort of stick behind the hourglass, so I could see whether it was refracted properly. (Depth for RayMir is 2, and it’s 5 for RayTransp)

I don’t know what I don’t like about it but I’m definitely not convinced by this picture. The water ends up being purple when it should be red (plus I did specify in the RedWater material not to receive any ambient color… Plus I don’t know, the colored water doesn’t look like water really.

Any suggestion to improve this poor result. I’m launching a render with Yafray so I can have a solid comparison basis…

Ari ;o)

EDIT: Here is the Yafray render (it rendered in something like 30 seconds! but it’s all wrong… RayDepth is 5

Well, I’m drawing a blank… I’ll try rendering again with a higher Depth value
@ PapaSmurf: that’s what they seem to advise when some parts of the picture appear black when they should be transparent: the ray could not bounce enough times, or something of the kind.

Hey, the problem isn’t the material settings. It’s the lighting setup. Remember that in 3D, we can’t actually recreate all lighting and reflection of the real world. Render times would be HELL!! Just use the Blender Internal engine… :stuck_out_tongue:

What you need is a 3 or 4 point lighting setup or something along those lines. Search the blender wiki. :wink: Please do, instead of just adding lights

Also, the water doesn’t need to be colored by maintaining it’s Alpha value. In the raytracing tab for the water matierial, under Ray Transparency set the Filter value to about 0.5. Also don’t forget to set the alpha to zero. Change both the reflection depth and transparency depth to 3. Also, have a reflection of around 0.15.

Go to your Shaders tab, and change your Cooktorr shader’s spec to 2, with a hardness of 200. Do this to both materials.

Remember that you can take advantage of your dual core or whatever by setting the number of Threads in the render tab to the same (or more) number of processors you have.

On your glass material, change the reflection to about 0.25. Set the depths to 3. Leave filter at zero, but change the IOR to about 1.40 ~ 1.45.

This was a 37 second render on a celery 2.66 with BI. (4 threads) Shadows take it out to about 3 and 1/2 mins. Default fluid settings, sim taking place over 250 frames, this is frame 70.

If you like it, the blend’s here. One of the first things I noticed with your scene, was how heavy it is. From memory, there was something like 75,000 verts in it.

I took the file you uploaded when trying to get from curves to a mesh, and spun both the glass and the liquid to give a total of 64 steps in 360 degrees. It comes to about 25,000 verts, yet I can see no difference in the edges - no sign of aliasing. Obviously, this will help substantially with render times.

I forget what I did with the materials, just append/link them in and compare.



Other people have given you good advice (e.g. improve the scene by giving the glass something interesting to reflect, even if it’s only a few emitting white planes; simplify your models).

A few other comments:

Your liquid intersects the glass. This will result in incorrect rendering at this boundary.

You’ve set translucency to maximum on your materials. Try setting it to zero. It’s a hacky setting that lights faces facing away from the light to fake translucency but won’t look good on your models.

Hope this helps.

Hey 'yall,

Thanks big time for all your great advice.

Here are two renders which followed changes I made in the scene. I’ve applied a four-point light rig, set the filter value instead of keeping the alpha up, removed the 3 SubSurf modifiers to decrease (drastically) vertex count, etc.

The first render I made was with Depth for RayMir at 3 and RayTransp at 3 too.
Here it is:

The second render is the same, except Depth for RayMir was 2 and RayTransp was 5.
Here it is:

I like #2 way better than #1

I’m now going to try and render again without translucency.

@ rawpigeon: I know the liquid overlaps the glass. I modelled it that way on purpose because I read on numerous tuts that it not overlapping it would get rendered as some kind of ice cube separate from the glass, and not as liquid filling the glass. So why did they insist? What should I do? Spin everything anew without any overlap?