2
$\begingroup$

I don't have any screenshots or reference images, but I'll try my best to describe the effect I mean. An simplified example of what I am trying to achieve is the following: There is a target object, and there is a controlling object. Where the controlling object touches the target object, the target surface turns [...],

(this is where the mix shader comes in place, so in an optimal scenario you could insert anything here, such as the target turning transparent or starting to glow)

everywhere else it is black.

I have seen a CG Geek Tutorial on how to achieve a similar effect to what I want, but in the tutorial he uses an object to control a modifier: https://www.youtube.com/watch?v=F13bnOCtYbA The problem is that there doesn't seem to be a proper way to use weight paint as a factor for materials.

Edit: I figured it out, this is the result I wanted: enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

gif_thingy

I decided to recreate the CG Geek Wireframe transition effect I had been using as reference. Just to avoid confusion: The wireframe look you see in the example is not a modifier but a simple shader using the wireframe node

1. The first step will be setting up the dynamic paint:

Select your target object (in this example: monkey) and set up a dynamic paint canvas in the physics tab. Set the Format to Image Sequence, surface type to "Paint", and enable the Dissolve option with a low time. You can play with the time value and the "slow" option, they basically define how fast the paint is going to disappear. dynamic paint

If we didn't enable dissolving at all, the paint would stay there and the target would stay visible once touched by the brush.

1.1

Next, add in a Brush object. This is the grey cuboid you can see in the example, and the goal is that everything within its volume is visible, while everything outside is invisible. You can theoretically use any mesh, but keep in mind that higher poly stuff might be more performance consuming.

Go to the physics tab and make it a dynamic paint brush object. Set the Paint color to anything, but make sure the alpha is set to 1. The Paint Source should be set to "Mesh Volume" or "Mesh Volume + Proximity", and again, you can play with all of the settings if you don't like what you see.

2. (Optional:) Keyframe/animate your object

This step is only important if you want to make an animation. If you want a still image, skip this.

3. Bake the dynamic paint

Select your canvas (target) object, go to the physics tab and set up the frame count fitting to your animation. If you are doing a single image render, set it to Start:1 End:1 so that it only bakes a single image and doesn't waste your time. Now scroll down to "output", set up the directory where you want to have the baked paintmaps saved. UV Unwrap your object and select the UV Map. Now you can Bake the image Sequence.

4. Shading

Now that you have the paintmap, you can use it as a factor for a mix shader node. Just add an image texture, select all the images and click open. If you want to have it respond live in the viewport, enable auto refresh. Add a Texture coordinate node and plug the UV Map output into the Vector input of the image texture. Add in a Mix Shader Node and Mix two shaders of your liking. In this Example I mixed Transparency ("Invisibility") with Emission. You can use anything else too. Plug the paintmap into the mix shader factor, and this should be it.

$\endgroup$

You must log in to answer this question.

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