1

I'm currently working on a video containing images against a black background. What I wanna do is to have the edges of my images fade to match the background. I'm looking for a node setup in the shader editor that allows me to integrate my image textures with a transparent or black gradient to blend everything together. The gradient would look something like this. The squares would represent my images.

enter image description here

To help illustrate what I'm trying to tell, here's an image of images that aren't blended in well to the black environment.

enter image description here

Trying to use color attributes to get the effect I want but I don't fully understand how to do it.

enter image description here

ProximaCc
  • 31
  • 3

3 Answers3

1

One option would be start with a spherical gradient texture mapped to the object coordinates and fudge around the values from there. This definitely achieves a vignette, but doesn't quite get as "square" as the example you provided.

Another option is to inset the plane and create a color attribute, painting the external vertices. You can then plug that value into the alpha channel as desired. This requires a couple extra polygons, but gives very similar results to your ideal look.

Additionally, you could just use an image mask, pretty much just the image you posted plugged directly into the alpha channel.

(See the image for examples of the first two examples.)

enter image description here

Legoman
  • 1,779
  • 8
  • 28
  • 56
  • I'm trying to do the second option you listed, have insetted the plane and created a color attribute. However, I currently don't know how you made two shader node trees for the same texture. I would want to achieve something like the fourth object you've shown and then replace the white from the color ramp with an image texture. – ProximaCc Dec 29 '22 at 06:48
  • I added another image to show where I'm at. – ProximaCc Dec 29 '22 at 15:48
  • Oh, it's two different shaders, I was just showing both. The one on the right is the one you want for the second option. Vertex painting is your friend! – Legoman Dec 31 '22 at 21:24
1

Perhaps simplest and most flexible is just to take the Generated Coordinate Space and use Separate XYZ and Color Ramps to define the edges you want, Math -> Multiply the results and send it into the Alpha channel.

This is a simple image on a plane with the setup I described.

enter image description here

Another quick example with Spherical Gradient.

Not everyone knows the names of the nodes to search for so the purple nodes are Vector Math.

enter image description here

Allen Simpson
  • 13,493
  • 2
  • 15
  • 57
0

UPDATE:

Here is a solution. By adding a gradient to each side of your image and plugging these into the alpha channel of your BDSF you can get the result you are asking about in cycles.

Notice that the image texture is connected to the emission socket so that the texture is not lost against a black background.

(Although I copied the gradient several times, it can be streamlined and done with less nodes, as Allen Simpson has shown.)

enter image description here

Here is the result:

enter image description here

previous answer

If you want to add the effect to all your entire render, here is my previous answer. This effect is called a vignette. Open the compositing workspace.Render an image or choose a suitable image.

Get a box or ellipse mask node. Add a blur and alpha over node. Here is the node set up. Adjust the size of the mask and the color for your style.

enter image description here

enter image description here

common_goldfish
  • 2,162
  • 9
  • 14
  • I hope that I have understood you correctly. Just a note that there are many good video tutorials online for this effect! Including some by our active members. – common_goldfish Dec 29 '22 at 01:45
  • https://blender.stackexchange.com/questions/39034/what-is-the-fastest-and-easiest-way-to-add-a-vignette-in-the-compositer-for-cycl – common_goldfish Dec 29 '22 at 01:55
  • Thank you very much for this information! It will definitely be very helpful in the future and I do plan to use this! However, I was wondering if I could apply a vignette effect to object planes in blender that have image textures on them via the shader editor. I realize now that I should've been more specific about the type of nodes setup I wanted. I added another image in my question to show my current problem. – ProximaCc Dec 29 '22 at 04:19