3
$\begingroup$

I made a material that mixes two shaders using an empty which acts like a kind of mask for those shaders. If I move my empty up, there will be more blue shader. If I move it down, there will be more transparent shader.

My goal here is to make a glass that would be filled with water; using a single mesh with this special material, and moving my empty to "fill" the glass.

enter image description here

It is working quite well, but... As the material goes along the mesh, it shows up like if the mesh missed a face; has its "cap not filled". I was wondering if it was possible to tweak my blue shader so the mesh would always seems closed ?

enter image description here

Thanks !

$\endgroup$
3
$\begingroup$

Staying inside Cycles alone might not produce the desired results..

enter image description here

Here i'm using the Z component of the Geometry's position socket to compare with a scalar value (Representing the distance from the ground)


Most likely you'll need to animate a boolean intersection with a plane, one slice of will be the glass/transparent material, the other slice will be the solid/diffuse material (or whatever you want).

Here i've separated them spatially to indicate they this method uses two X Objects to and two planes, both planes point in opposite directions:

enter image description here

The closest I get without making it complicated is this:

enter image description here

It uses the Normal of the upper cut to decide how much to mix between glass and transparent. The normals pointing downwards (on the cutting surface) are the faces that are mixed to Transparent most. The exact shader mixing is something you'll need to decide on yourself.

$\endgroup$
  • $\begingroup$ for a proper fill effect you might have to make a shrunk version of the X (offset inwards), and only animate that with the boolean intersection / plane. The outer regular X shell would then stay static. $\endgroup$ – zeffii Nov 25 '15 at 13:02
  • $\begingroup$ Ok, thanks for your reply ! I was wondering if it was possible without using booleans but apparently no. Thanks ! $\endgroup$ – gordie Nov 25 '15 at 14:29
  • $\begingroup$ You didn't mention wanting to avoid the Booleans in your question, it might be possible.. but the creation of that extra set of internal faces to resemble the liquid surface will still need to be done with a real mesh I think.. Wait around for a better answer $\endgroup$ – zeffii Nov 25 '15 at 15:03
  • $\begingroup$ related: blender.stackexchange.com/questions/8600/… $\endgroup$ – zeffii Nov 25 '15 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.