View Full Version : Change texture based on distance

02-04-2012, 09:37 PM
I can set up changing the color based on distance to a null thanks to William's excellent tutorial, but what I really need right now is to swap between two images instead of colors. I'm not having much luck, any suggestions.

Here's what I've got:

Edit: As usual I messed with it forever, then post here about it, then immediately figure it out. I just had to connect the gradient's Alpha to the images Opacity AND have the color connected.


02-04-2012, 09:43 PM
Maybe drive Opacity based on null distance?

02-04-2012, 10:59 PM
Right, that's what I did.

02-05-2012, 08:44 AM
Do you have the link to williams tutorial?

Although, you could add a clip mask Render - Clip Mask,

Think of it like layers in photoshop only two similar objects, with different texture.

Make a gradient and do distance to object, and add in alpha through there. So that when the null is X distance close to object, then it will show the object behind.

I'm not sure that would work but worth a try I guess?

02-05-2012, 09:04 AM
It's from this page:

Here's the specific video:

02-05-2012, 04:55 PM
Add two image nodes, then color mixer node, plug them in it, output from color node to Color input in Surface.
To opacity of color mixer plug output from gradient node.
To input of gradient plug output from distance.