5
$\begingroup$

Why I can't make glow in Compositing in Cycles if emission is behind glass? If use Glare, everything in picture will be glow, but I don't need it. I need only certain parts to glow, for example, like here - bulbs in headlights.

enter image description here

$\endgroup$
7
  • $\begingroup$ why do you want to do this in compositing? isn't it easier to create an emission for the bulb lights and turn "bloom" on? $\endgroup$
    – Chris
    Jan 27, 2021 at 10:16
  • $\begingroup$ @Chris, Bloom is for Eevee, not Cycles, it looks like he's working with 2.79 $\endgroup$
    – moonboots
    Jan 27, 2021 at 10:36
  • $\begingroup$ thanks, but yes i know, and how should i know he uses Cycles? $\endgroup$
    – Chris
    Jan 27, 2021 at 10:51
  • $\begingroup$ Yes, I want to know how to do this exactly in Cycles. $\endgroup$
    – Juliya
    Jan 27, 2021 at 10:58
  • 1
    $\begingroup$ @Chris, Eevee was not in 2.7, at least it was not installed by default $\endgroup$
    – moonboots
    Jan 27, 2021 at 11:17

3 Answers 3

1
$\begingroup$

You need to use a trick because alpha is not use for glass transparency so you can't isolate the glass object.

You can fix it in the Compositor with this trick:

Here Jordan Sautron explains how to give an effect to an Emission object behind a glass. It's in french so I try to summarize.

  • Give a Pass Index to your emission material (Properties > Material > Viewport Display > Settings), for example give 1.
  • In Properties > View Layers > Passes > Data, activate Indexes > Material Indexes.
  • In the Compositor, create a Render Layer with the glass, a second one without.
  • Create a Converter > ID Mask node in front of the second Render Layer node, type the material index of the emitter material (1).
  • Create a Color > Mix node (Multiply mode). Plug the first Render Layer node in the first socket, plug the ID Mask in the second socket.
  • Plug the Mix into a Filter > Glare node, put its Mix value at 1.
  • Plug the Glare into the second socket of a Color > Mix node / Add mode. Plug the first Render Layer in its first socket, put its factor at 1 or more.

enter image description here

Another solution is to fake the glow effect with the Layer Weight node: Create a sphere around your light object and give it a mix of Emission and Transparent nodes, with a Layer Weight as factor:

enter image description here

Of course you can make it a bit more complicated with some noise etc:

enter image description here

You can even give it a Displacement node. In that case don't forget to go into the Properties panel > Material > Settings > Displacement > Displacement Only:

enter image description here

$\endgroup$
7
  • $\begingroup$ This is useful tutorial. And thanks for translation from french. Only using different layers is not very convenient. Rendering almost the same picture 2 times is long, especially for animations. But I suppose that can transfer objects with Emission to another layer & render it instead of the whole picture without glass. It will be much faster this way & I think result will be the same. $\endgroup$
    – Juliya
    Jan 28, 2021 at 7:11
  • $\begingroup$ if you don't care about too much realism you have tricks to create this kind of effects like for example create a sphere with transparency and emission mixed into a mix shader with a layer weight as factor, please tell me if you want me to show you $\endgroup$
    – moonboots
    Jan 28, 2021 at 7:12
  • $\begingroup$ Yes please, show me what you mean if possible. $\endgroup$
    – Juliya
    Jan 28, 2021 at 7:17
  • $\begingroup$ ok I've edited, I'll show what it gives with a bit of noise... $\endgroup$
    – moonboots
    Jan 28, 2021 at 7:21
  • $\begingroup$ It looks impressive. I think I'll find application for this. Thanks for all. $\endgroup$
    – Juliya
    Jan 28, 2021 at 12:29
4
$\begingroup$

As an alternative to blur, use a glare node. It will give you finer control since the effect is based on a threshold, to effect the picture based on the brightness of the pixels.

enter image description here

Read:

Any way to control light halos in the compositor based on emission level?

Also, the default glass shader will not work correctly for a light that is behind glass.

Try something like this:

enter image description here

Read: How to illuminate the darkness inside glass objects in Cycles?


If you must use glow, you can use a pass index to determine what gets blurred.

For complete instructions on how to set this up read:

One part of the render layer glowing?

$\endgroup$
1
  • $\begingroup$ Thanks for detailed explanation of how Glare node works. But ID mask for Glare also doesn't work if Emission is behind Glass. I need to use ID mask to set strength, shape & glow for each light bulb separately. Simply using Glare won't give the desired result. $\endgroup$
    – Juliya
    Jan 28, 2021 at 7:10
0
$\begingroup$

If your emission has a very specific color which is not found elsewhere in the picture, you can also easily solve it by just chroma-keying/color-keying it to get your original mask:

enter image description here

(Here I use several "glare" masks to have a stronger effect, but I guess you could use a Gaussian or any other kind of glare)

$\endgroup$

You must log in to answer this question.

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