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!
1 Answer
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.
Add this node-tree as Factor for Mix Shader...
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.
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).
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.
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.
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.
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.
- $\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– user1235112022-06-03 21:14:52 +00:00Commented 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– user1235112022-06-04 12:37:09 +00:00Commented Jun 4, 2022 at 12:37










