2
$\begingroup$

For an animation project I'm working on, some vehicles with a warning light - these plastic ones with a rotating mirror inside which you can find on top of police cars, firefighter trucks (blue) or excavators and construction trucks (orange).

Some time ago I read a question (I am not sure if it was on stack exchange or somewhere else) where someone wanted to create glowing buttons. The answer which was given to him was something like "cycles is a physically-based renderer, so try to model like in the real world". So the solution for that was to model a button and put an object emitting light below.

With that answer in mind, I modeled the light as it looks like in the real world. A basic plastic casing with a separate transparent part (Glass BSDF), the mirror (Glossy BSDF) and a kind of light bulb (Emission). So far so good. The problem with that is, you need an unreasonable number of samples to make it look alright. You can have a look on my results below.

256 samples, 960x540 (25% of 1080p) - 0min : 31sec blue light 256 samples

1024 samples, 960x540(25% of 1080p) - 2min : 34sec blue light 1024samples

4096 samples, 960x540(25% of 1080p) - 8min : 12sec blue light 4096samples

This example scene has only ~1500 verts and the same for the faces. The vehicles I made have up to 80k faces and there is also a landscape around.

My question is: Is there a better way (in terms of rendering time) to achieve the same or a similar effect?

Thanks in advance nioerd

--- edit ---

An image how the scene looks like with the changes suggested by pycoder (change the glass material of the bulb and the hull to a material which is only viewable for the camera)

256 samples, 960x540 (25% of 1080p) - 0min : 30sec changed scene with 256 samples

I can't see any real difference between my first try and the suggestion by pycoder, except that there is no illumination from inside the hull. Even the time needed for rendering does not realy changed. Did i do something wrong?

--- edit 2 ---

Added the model to download via blend-exchange.

$\endgroup$
  • 1
    $\begingroup$ Lights inside glass is very tricky for cycles to render. See blender.stackexchange.com/q/10434/599 and its linked questions for a more detailed explanation (and some work-arounds) $\endgroup$ – gandalf3 Sep 2 '16 at 21:14
1
$\begingroup$

In the glass shader you need to use the light path node. Setup your material so the main section gets mixed with a full transparent shader by way of the camera output of the light path node.

enter image description here

This will make your glass look like glass when the camera sees it, but not even exist when other objects see it. Doing the same with the bulb and then adding a point light would also be an improvement to sample count.

Note: This is not physically correct. To get better render times from cycles, you need to pull tricks like this to improve sample count.

Edit:

After playing with your file I got this (25 samples):

enter image description here

Here's what I did - switched device to CPU and disabled reflective caustics. (I also did a little trick with smooth shading to improve the look of the siren, but that's another topic.)

enter image description here

Here's the new blend:

$\endgroup$
  • $\begingroup$ Thanks for your fast answer. I tried your suggestion and took 2 images with and without the surrounding cap of the light : with and without. I changed the material for the cap and die light bulb to your example (light bulb is not emitting light anymore) and added a point light in front of the light bulb. With a white point light the whole scene turned white, so i changed it to blue. For me it seems like the point light is not interacting with the rest of the object - so there are no shadows as seen in my attempt. Am i wrong? $\endgroup$ – nioerd Sep 2 '16 at 13:11
  • $\begingroup$ The point light WILL interact with the base of the object if that's what you mean (the plastic sort of thing), but WON'T interact with anything that has used the "trick." Please post (all) your images on blender stack exchange -- I can't see them right now. Make sure the point light is set to contribute to shadows though in the cycles object settings. $\endgroup$ – JakeD Sep 2 '16 at 14:33
  • $\begingroup$ I updated my question with an image of how the scene looks like using your suggestion. Unfortunately I did't save the blend file from which I took the images in my last comment and I wasn't able to recreate it. $\endgroup$ – nioerd Sep 4 '16 at 10:32
  • $\begingroup$ That was sort of the opposite of what I was trying to tell you :-) It should be visible to the camera and invisible to everything else. If you post your blend, I can show you what I mean. You can post it here for BSE questions: blend-exchange.giantcowfilms.com $\endgroup$ – JakeD Sep 4 '16 at 11:13
  • $\begingroup$ I added the blend =) $\endgroup$ – nioerd Sep 4 '16 at 14:49
0
$\begingroup$

Other than the changes in materials you might get as answers. You can try clamping, filter glossy, and using a stronger light source. If the plastic casing is made from many materials with a mix shader, set the factor as (is transmission ray) from light paths where the blue-coloured material is the one on the bottom. Clamping can be found under sampling, set the clamp indirect to 9 and keep getting down until you find a noticeable effect. Filter glossy is under light paths and I usually set it to 0.5

Lots of changes which could be made to reduce fireflies could be found here.

$\endgroup$
  • $\begingroup$ Thanks for your answer, but actually I'm looking for a way to get working warning lights with less computational power instead of a solution to reduce the fireflies (someone changed the title of my question). $\endgroup$ – nioerd Sep 4 '16 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.