6
$\begingroup$

So I have a stain texture I want to use.

enter image description here

But as you can see it's not a splat, like this one.

enter image description here

I really want to use the first one, but its a rectangle. So I want to know how to make it grow transparent around the edges of the texture (which I want to put on a plane and put in front of my wall in the scene) in Cycles so it fades out and fits in better with my scene.

$\endgroup$
6
$\begingroup$

I once had to do something similar, and I've used two different solutions.

1) Simply add an alpha channel to the image, or create a separate grayscale alpha map to use alongside it.

2) Inset the mesh, with the resulting face being close to the edges (or further, as desired). Then go to Vertex Paint mode, and set the vertices along the edge to black, and the other vertices to white. The Vertex Colors are exposed to cycles via the Input->Attribute node, where you type in the name of the Vertex Color dataset (Col by default).

To get the transparency, you plug the alpha (either a map, channel, or vertex color attribute) into the factor input of a Mix Shader node, with one input being Diffuse BSDF (or whatever you're using) and the other being a Transparent BSDF node. You can use the Color->Contrast node on the alpha input to make it less gradual, or use a Converter->Color Ramp instead.

The image below demonstrates the second technique, using vertex colors:

enter image description here

|improve this answer|||||
$\endgroup$
  • $\begingroup$ Regarding the alpha map, I was able to do this with gradients and mapping. $\endgroup$ – SilverWolf - Reinstate Monica Nov 14 '17 at 16:12
4
$\begingroup$

If you load the image into Blender using the bundled Import Images As Planes Addon and then enter Texture Paint mode, you can isolate parts of the image you want to use.

I used the Color Burn paint mode to darken the center areas and Color Dodge to lighten the edges of the image to hide the "Squareness"

Now the image can be saved with a different name as a second image to be used as a mask.

enter image description here

Now if you setup the Cycles nodes as shown in the previous image and adjust the Color Ramp node, you can alter what parts of the original image are shown.

enter image description here

Once you have it looking the way you want, you can duplicate the image in your hard-drive directory, rename it, and then dragNdrop it into the Node Editor. Now if you bake the material, this texture will contain the final result so it can be used for any Blender renderer or external program.

enter image description here

Here is the final baked image.

enter image description here

|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.