1

The problem was acceptably solved by using ideas from Hexbob6's reply, plus the ideas from the link he gave me in discussion of his reply (the link is in the discussion of his reply).

Problem's very gist: Need to maintain the glow of a colored lamp's hot element (the glow remains visible even in rotation, when the hot element of the green lamp disappears from sight but a part of the lamp is still seen), plus to have the element's color be close in color to its blackbody temperature all the time (and the glow be affected by it).

Tried to add glare to hot element before Z combine - didn't work (no glare visible at all). Only worked if whole scene uses glare [2.png]. Plus if the scene is rotated such that the hot element is not seen on screen directly [1b.png], the light is not giving out the glare or shine from the lamp. Tried to Alpha-Over the glare-added colored glass (without the hot element) in the compositor onto the whole scene [4.png], but the solid case around the colored glass wrongly looked transparent.

If I could also have an advice on how to make a very/even more realistic light like this, it would be really nice. Thank you!

Edit: If anyone could help with a custom node setup to control the length of light falloff such that the non-compositor "glare" fades out right after leaving surface of the colored glass (and before it leaves the volume scattering enabled cube around it which otherwise makes the glare to have a square shape), it would be really nice. Thanks a lot!

4: enter image description here

3b: enter image description here

3a: enter image description here

2: enter image description here

1a: enter image description here

1b: enter image description here

Dmitri
  • 25
  • 4
  • 1
    The issue stems from the fact that the Glare node in the compositor is a post-production effect, and doesn't take into account actual cycles emission materials. Instead, it bases how much glow to give the image based on how bright the rendered pixels are (hence the brighter green receives glow, because it is brighter). You could try increasing the Threshold value of the Glare node to see if you can capture all of the green pixels (viewable by setting the Mix value to 1), or you could use a different method entirely (material/object IDs or volumetric materials to simulate fog). – Hexbob6 Aug 16 '18 at 21:26
  • Tried material ID, didn't work out well for some reason - the color of the hot elements gets changed to purple, etc.: https://snag.gy/ux7IlD.jpg. As for volumetric scattering, I don't know how to make the rays shoot a shorter distance from the lamp, plus it renders too slow. – Dmitri Aug 17 '18 at 08:45
  • interesting, I can't see what would be causing that purple colour! Are you rendering using the Filmic colour management settings? I know not all mix nodes support it (possibly neither Alpha Over?) and you can get weird artefacts such as those? – Hexbob6 Aug 17 '18 at 12:08
  • No, not the Filmic c/m was used for the renders. It was fine and then it became like that when I kept on tweaking. – Dmitri Aug 17 '18 at 12:29
  • Any idea how I can control light fall off using ray length to make volume scatter rays be so short they fade almost right away after leaving lamps surface (which produces a sort of a small glow) ? (Can't figure out the node set-up) – Dmitri Aug 17 '18 at 13:14
  • Found one set-up on https://blender.stackexchange.com/questions/983/exclusive-lighting and https://blender.stackexchange.com/questions/1818/is-it-possible-for-light-sources-in-cycles-to-have-nonphysical-falloff-like-in-b and it sort of worked after some tweaking (https://snag.gy/a0cujV.jpg, https://snag.gy/0C4M2r.jpg, https://snag.gy/cNZVYi.jpg, https://snag.gy/90cwpr.jpg, https://snag.gy/IruKtH.jpg), but still not really what I was looking for. Can't get the light to fade sooner. – Dmitri Aug 17 '18 at 15:36
  • The following set-up appeared to be a good improvement: https://snag.gy/L4dAtk.jpg. The next step (for another question if I need to) would be to take the light after it escapes the colored glass and to apply color ramp or something else to try to make the hot element yellowish (its plain green now). – Dmitri Aug 18 '18 at 06:41
  • @Dimitri is this more of the effect that you were looking for? If so I'll write a quick tutorial in the answer below :) // https://snag.gy/KTcW49.jpg // https://snag.gy/te3qj7.jpg // – Hexbob6 Aug 18 '18 at 12:33
  • @Hexbob6: Thank you very much! This is pretty much it. Twice or trice more glow is even better though. Thanks so much for the offer. I'm definitely saying yes. Sounds absolutely fantastic! – Dmitri Aug 18 '18 at 15:45
  • If you could also colorramp the element's core to look yellow from the glow (I don't know how to do it), it would be even better. Though already it would be so unbelievably nice of you!!! – Dmitri Aug 18 '18 at 15:49
  • @Dimitri no problem, the technique is a compositing effect, rather than in-camera, but it should allow you to scale the intensity of the glare, alter the colour and increase the falloff distance. – Hexbob6 Aug 18 '18 at 16:36
  • Let's see!! Sounds good enough! – Dmitri Aug 18 '18 at 17:20
  • In Blender it's not 100% physics anyway - it ain't taking gravitational lensing into account, does it?! So, what works, works! – Dmitri Aug 18 '18 at 17:21

1 Answers1

0

How to Create a Glow Effect in Cycles


Okay so although you suggested that you'd prefer this not to be a compositing-based solution, as mentioned in the comments I'll put this together regardless as it is a very useful and adaptable effect.

Here's the end result of what we'll be creating:

Final Result Montage

The bulb itself is fairly simple, with a coloured-glass, domed bulb and an inner filament object. The materials are also fairly simple. The glass bulb simply uses the Principled BSDF shader with the following settings:

Glass Shader

It is also important to set the Pass Index to 1 in the Settings dropdown of the Material tab in the Properties panel, as this will create an ID mask of the bulb object visible to the camera, which we will use in the compositing step. The final part of this process is to adjust the render and scene settings. Rendering glass with a thickness is always a bit process-intensive and can cause fireflies and noise, so I used the Branched Path Tracing method with the following settings to help reduce it:

Render and Scene Settings

Now, once that is rendered out, on to the compositor! The first step is adding a Glare node and adjusting the threshold and size. This step will require tweaking on a per-scene basis, but it will add a centralised glow at the heart of the bulb, wherever the filament is visible.

Step 1

Next, the outer-glow effect can be developed. Remember that material Pass Index that we set earlier? We'll access that with an ID Mask node, giving us a b/w mask of only the bulb.

Step 2

Using this mask, we'll now add a Blur node and set it to Fast Gaussian. This node will act as the 'spread', or light falloff control, of our lamp; the greater the blur, the larger the width of the glow.

Step 3

The penultimate step of the compositing process is adding a Color Ramp to act as our light intensity controller. The left side of the ramp should be set to pure black, however the right side should have a dark-grey value. How dark this right side is, defines how intense, or bright, the final glow will be, and should be adjusted accordingly.

Step 4

Finally, this edited mask can be used as the Fac input of an Add node to mix between the original image and a glow colour. This glow colour should technically be the colour of the bulb's glass shader, however you can be artistic with it!

Step 5


And there we go, a compositing node setup that adds a realistic yet entirely customisable glow to the render! Here's the final node setup in its entirety, and I've also added my .blend file to you to play about with as well.

Final Setup

Hope this is of some help to you, and don't forget to upvote/mark as the right answer if it is! :)


Hexbob6
  • 2,038
  • 1
  • 19
  • 27
  • That worked really well (https://snag.gy/I0bBoW.jpg, https://snag.gy/HtAJRa.jpg)! Composer CAN be used for this kind of thing afterall! I couldn't get the core to yellow-out when I tilt the lamp toward's the scene's back though. The effect gets layed on top of the picture like this: https://snag.gy/WBqv1Q.jpg. I guess I would need Z combine and renderlayers for the element material? – Dmitri Aug 19 '18 at 05:03
  • In particular, the following set-up is troublesome to me in this regard: https://snag.gy/ZYE0Km.jpg. I want to make an animation, and to be able to tilt the lamp without loosing the yellow effect. Any idea whether I should use alpha-over or the math-add (neither works as the summing node), or somethign else here? – Dmitri Aug 19 '18 at 16:07
  • Your tutorial is an eye opener in many a regard. You are a very good teacher! Thank you very much. And I am sorry if I seem like a never-happy idiot with all my after-questions. – Dmitri Aug 19 '18 at 17:39
  • At the top (https://i.stack.imgur.com/K2O9H.png) your result had a yellow core, and possibly the same set-up didn't exhibit the yellow glow overlaying when the model is tilted (https://i.stack.imgur.com/K2O9H.png). How did you connect things in the composer for that if so? – Dmitri Aug 19 '18 at 18:18
  • @Dmitri the yellow core is a secondary glow effect added manually around the filament object. Your original question wasn't related to animation so the solution is tailored to suit a static rendered image. Technically, I believe, you wouldn't get the orange glow if the filament object isn't in direct view of the camera, as the bulb itself is green... (cont.) – Hexbob6 Aug 19 '18 at 23:48
  • ... On this logic you could probably add another Pass Index to isolate the filament and repeat the steps in the tutorial to create the second glow, but that runs into the issue described here https://blender.stackexchange.com/questions/103310/how-to-utilize-material-or-object-index-behind-a-refractive-material-in-cycle , and solving that is an obstacle in and of itself which would go far beyond the scope of the original question. – Hexbob6 Aug 19 '18 at 23:49
  • Interesting and challenging! Will definitely look into that! Thanks a lot again for your help - I am extremely grateful to you for it!!! – Dmitri Aug 20 '18 at 03:06
  • @Dmitri , no problem, if it did help as I mentioned could you mark it as correct so that others visiting the question can view it as being solved? Thanks! – Hexbob6 Aug 24 '18 at 19:50
  • I'm sorry I didn't realize I had to tick the checkmark for that. Earlier I clicked to up the answer but didn't have enough privilege. – Dmitri Aug 26 '18 at 05:24
  • I went to the link you gave and used Rich Sedman's answer to create the mask for the glowing element which is inside the colored lamp. Then I alphaovered the blurred and color-changed glow of the mask itself on top of the lamp's glow to create the effect I needed. Thanks for the link! (1) https://snag.gy/wPclam.jpg, (2) https://snag.gy/SEimI4.jpg, (3) https://snag.gy/kEV6vZ.jpg. Here I have created a material called mask and assigned it as the override material of the layer used for the mask. The hot element's object ID is 10 and the lamp's 5. – Dmitri Aug 27 '18 at 09:09