2
$\begingroup$

In Photoshop and some other image editing programs, Blending modes allow you to composite images by creating various types of transparencies that adapt to other layers. The user can quickly cycle through different Blending Modes with a keyboard shortcut.

Here's an example of a composite image made with Blending Modes:

enter image description here

These are the different Blending Modes in Photoshop:

enter image description here

In Blender, transparency is usually done in the Cycles render engine, in the form of shaders applied to a material or an imported image. The Compositor can also be used, but usually applies to the whole image outputted (if I understand correctly).

However, I am trying to understand how this works better. Say I want to "fake" smoke with a 2D alpha layer, or use a Color Dodge blending mode for a mesh, how would I proceed?

I could only find this reference online, which seems obsolete and whose links are broken.

How would I try different Blending modes for 2D layers or meshes as can be done in Photoshop? How many different Blending Modes can be produced, and how?

(I understand the tools are very different, and I do know how Nodes and materials work pretty well.)

We can use this file for tests

$\endgroup$
7
  • 1
    $\begingroup$ In Cycles, for images used as textures in materials you use the color mix node and then choose the mix method. docs.blender.org/manual/en/dev/compositing/types/color/mix.html $\endgroup$
    – user1853
    Commented Jun 27, 2017 at 19:06
  • $\begingroup$ What if it's just an image imported as a plane? Or a whole mesh? $\endgroup$ Commented Jun 27, 2017 at 19:09
  • $\begingroup$ Same thing you can mix the images before the color socket in the shader. $\endgroup$
    – user1853
    Commented Jun 27, 2017 at 19:09
  • $\begingroup$ On the compositor you'd combine images and render layers the same way.\ $\endgroup$
    – user1853
    Commented Jun 27, 2017 at 19:10
  • $\begingroup$ Great comments. I'm curious to know if people have tinkered with this before and have found Node setups that match "Screen" or "Overlay" or any other Blending Modes, instead of having to find out by trial and error... These setups could even be shared for the greater good $\endgroup$ Commented Jun 27, 2017 at 19:15

1 Answer 1

4
$\begingroup$

Blend modes are implemented in the Color>"MixRGB" node, and are almost the same as in any layered 2D graphics software, like Photoshop or Gimp.

Premise

Such Nodes don't act in the 3D world, but either on the 2D space of a surface's material or on the (still 2D) space of the rendered canvas.

In the 3D raytraced rendering, the color and intensity of each ray that hits the camera depends on its path through the scene's materials, that can be comprised of reflections, refraction, translucency, diffusion etc, in a way that is meant to be faithful to reality.

In principle, you can't make two distinct objects "blend" their appearance in the 3D scene through 2D blending modes, i.e. by just arithmetically adding, subtracting, averaging the colors of different layers. If you're looking for a way to fake this behavior, then my answer isn't the right one for you.

To create a textured material for Cycles whose (2D) texture is obtained by blending different layers, you can follow these steps.

  1. Select your object and assign an UV map to it. I've done this by selecting it (in my example, half a cylinder) in edit mode and hitting U.

    Creation of a UV map

  2. In the UV/Image editor window, open all the images that you will need as layers

    Open new pictures

  3. Then create a new material and open the Node editor window.

  4. Add new nodes by clicking "Add". You will need:

    • An "Input">"Texture Coordinate" node, and its "UV" socket to obtain information from the object's UV map

    • As many "Texture">"Image texture" nodes as your layers. Remember to connect their "Vector" input to the "UV" output from the Texture Coordinate node

    • Several "Color">"MixRGB" nodes to do the actual blending pairwise. They are displayed with different names in my screenshot, depending on the selected Blend mode.

    • Any "Shader" node (in this example, "Diffuse", that should be already present by default). This will take the Color output from the last MixRGB and its output will be plugged into the "Surface" socket of the Material.

  5. Here's the complete node setup based on the example in your question

    Complete node setup

  6. And here's the rendered result

    Rendered result

$\endgroup$
2
  • $\begingroup$ Thank you for this! So if I understand correctly I cannot import, say, a cloud image as a Alpha PNG in a scene and blend it to a landscape, unless the landscape is a 2D image? $\endgroup$ Commented Jun 28, 2017 at 17:10
  • $\begingroup$ No, you totally can! But not through a layering similar to photoshop. You can have the Alpha PNG as a texture for an object in the scene. If placed in the right place, Cycles will render it as it was a real semi-transparent thin film in the 3D world. You can use the add-on Import images as planes. $\endgroup$
    – Nicola Sap
    Commented Jun 28, 2017 at 17:15

You must log in to answer this question.

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