5

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

Juliya
  • 345
  • 5
  • 16

3 Answers3

4

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?

susu
  • 14,002
  • 3
  • 25
  • 48
  • 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. – Juliya Jan 28 '21 at 07:10
1

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

moonboots
  • 155,560
  • 7
  • 105
  • 171
  • 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. – Juliya Jan 28 '21 at 07:11
  • 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 – moonboots Jan 28 '21 at 07:12
  • Yes please, show me what you mean if possible. – Juliya Jan 28 '21 at 07:17
  • ok I've edited, I'll show what it gives with a bit of noise... – moonboots Jan 28 '21 at 07:21
  • It looks impressive. I think I'll find application for this. Thanks for all. – Juliya Jan 28 '21 at 12:29
  • This (first) solution will not take into account deformation of light created by the glass right? For instance if you are trying to make this picture glow, you would glow along the original picture right? – tobiasBora May 03 '21 at 08:40
  • hello, it's a long time ago, I guess you're right – moonboots May 03 '21 at 08:52
0

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)

tobiasBora
  • 1,149
  • 12
  • 26