6
$\begingroup$

enter image description here

I am making an animation with a mesh deforming itself on a 100% transparent surface , but i need to make it so the part of the the mesh pressing against the surface appears darker ,from an inside perspective like the picture i posted as reference

In Eevee

( I am not looking for realism , the fact that glass don't work that way is irrelevant )

$\endgroup$
1
  • $\begingroup$ I tried to come up with a better solution than the answer I gave here, but I still have to find one. $\endgroup$ Commented Feb 22, 2022 at 8:35

3 Answers 3

11
$\begingroup$

Maybe a Boolean?

  • Duplicate the window pane as a non-rendering cutter object
  • Give the cutter the 'pressed skin' material
  • Ensure the cutter and the pressed object have both 'pressed skin' and 'skin' materials in their slots, even though each has only one of the materials assigned to faces.

When the deformed object is assigned a Boolean modifier, targeted on the cutter, set to 'Difference', the 'pressed skin' material will shade the intersection:

enter image description here

$\endgroup$
5
  • $\begingroup$ Ah, that's better than my solution. ;) $\endgroup$ Commented Feb 22, 2022 at 8:41
  • $\begingroup$ @GordonBrinkmann Yours gets a +1 from me.. depends on the workflow. Yours might be less fuss and more general. $\endgroup$
    – Robin Betts
    Commented Feb 22, 2022 at 8:42
  • 1
    $\begingroup$ Maybe... I guess both our answers will become a fuss if you want it to be more general - in the example image I already see two different "pressed" materials, the one on the skin and the one on the hair. If there are more parts pressing against the glass this will be annoying. I thought of something for the glass, like "if there is contact (or maybe some overlapping) darken the transparency so that the contact parts look darker". But I didn't get that to work. $\endgroup$ Commented Feb 22, 2022 at 8:48
  • 1
    $\begingroup$ @GordonBrinkmann .. Dynamic Paint / Light Path .. those are options, too. Oops! looks like this one is good enough :) $\endgroup$
    – Robin Betts
    Commented Feb 22, 2022 at 8:55
  • 1
    $\begingroup$ Yes, I thought of Dynamic Paint and Light Paths as well... but Light Paths didn't work as I expected and Dynamic Paint has a similar problem as our solution - you have to adjust it for all objects :/ $\endgroup$ Commented Feb 22, 2022 at 9:12
5
$\begingroup$

I imagine that the mesh pressed against the glass surface is furthest in some direction like +X/-X or +Y/-Y? This might not be the best solution, but maybe as a workaround you can compare the mesh's position to some other position (of an Empty for example) in a specific direction with a Greater Than node and use that as a mix factor between a lighter and a darker color. This way you can adjust how much of the mesh is darkened by the position of the mesh itself, by the value to compare it with and by the position of the Empty. The Mix RGB also allows you to not just darken the color, but also maybe choose a slighty different color.

darken by distance

$\endgroup$
2
$\begingroup$

If you just want to change the shader by a plane, you can use this simple node setup here:

enter image description here

result:

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Like my version, only that I'm using X instead of Z, an empty instead of a plane and didn't animate it...? $\endgroup$ Commented Feb 22, 2022 at 14:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .