1
$\begingroup$

I am trying to achieve the following effect. Stones are falling towards some trees. But before the stones hit the trees, a shield appears and blocks the stones. The stones generate some shockwaves on the shield. At the moment I am using dynamic paint with a sphere (glass material) as the shield. The stones are the brush. The issue: I only want the glass material to be visible where the waves are. The rest of the sphere should not be visible. I was thinking about using the waves as a mask using a vertex color node. The problem is, there is no "wetmap" Output as it is the case when using "surface type: paint". Is there a way to use the waves as a mask? thank you!

Shield1

shield 2 + ShockWaves

no mask available

$\endgroup$

1 Answer 1

2
$\begingroup$

Since your model is a Sphere you can use simple Spherical Gradient texture ...

I used Pink for parts stretched up and Green for down to better visualise it ... you should use white instead to result factor properly.

enter image description here

Add this node-tree as Factor for Mix Shader...

enter image description here

Note: This works only for Sphere object or you can use Linear gradient (for Plane object) for any other base shape you would have to use technique based on stretching like Tension Map add-on

Behind the Scene

For an illustration, if you take a Sphere and cut out a quarter to see into the Sphere's centre, you can play with and see what is happening under the hood.

enter image description here

Blender's textures are 3D it means when you are using Spherical Gradient texture it is not a circle, but as name state it is sphere like your shield object, just described by black&white colours (white at zero position (centre) and black at 1 m distance in all directions by default).

enter image description here

What you want to do is isolate (or highlight) waves. On surface a waves appears as vertices moved up/down from original position, it means you are looking for something that change color of geometry that is somewhere else than at zero position. There are several ways to do that. I tried the simplest one.

To colorise sphere's surface by one colour and any geometry moved above or bellow by another colour add Colour Ramp node. I set Black color at a middle (0.5), Green at 0 and Pink colour at 1.

enter image description here

Now you need to move somehow black part of gradient to be at sphere surface distance from centre. There is again many ways, I used here Mapping node and scaled textures coordinates.

Since this default Sphere is 1 m radius (2 m dimension) it is the same as gradient - middle black appears at middle radius distance. Texture Coordinates are set Object so just Scale mapping at 0.5 * it scales whole gradient and moves middle (black) at exact place - sphere's surface.

enter image description here

I added a plane on side to see also a part of colours out of sphere radius. Now just adjust gradient sliders as you need.

enter image description here

Note: Scale (Mapping node) - I know, confusing, but it is how it works. Half scale means -only half of original distance occupy the original distance - it means its bigger, if you set scale 2 it doesn't mean it is twice bigger, but the original spacey occupy by of two original distances - it means it is smaller.

$\endgroup$
2
  • $\begingroup$ thank you so much! I don't know exactly WHY it works, but it does :D May I ask how you came up with this solution? $\endgroup$
    – user123511
    Jun 3, 2022 at 21:14
  • 1
    $\begingroup$ really well explained! Thank you very much for bringing some light into that topic for me. $\endgroup$
    – user123511
    Jun 4, 2022 at 12:37

You must log in to answer this question.

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