Blurry Reflections without the huge render time

JonstarkJonstark Posts: 2,738
edited December 1969 in Carrara Discussion

I was researching how Carrara handles reflections and experimenting got some interesting results that I thought might be of interest to others.

If you've ever tried to render a scene that included blurry reflections using global illumination, you know that Carrara doesn't do well with this. It can turn a render that otherwise would take less than an hour to render into something that takes 24 hours or more. It may be pure reflex to never ever check the box to give blurry reflections, just because the cost in render time is so outrageous.

But blurred reflection can really help a scene's textures and improve the quality of the render, and so I was looking for a way to still use blurred reflections without having to wait for loooong render times.

So first up, here's the scene setup that I used for my experiments. Very simple, just a sphere and a cube primitive (I added the infinite plane in the first place so they wouldn't seem like they were floating in the blackness)

Blurry_Reflections_setup.png
900 x 506 - 14K
«1

Comments

  • JonstarkJonstark Posts: 2,738
    edited December 1969

    Alright, so for my first render I got rid of the infinite plane, and any and all lights in the scene, including turning the ambient light in the scene tab down to 0%. I added 100% reflectivity to the sphere. I put an hdri map into the background, but again there is absolutely no lighting in this scene whatsoever. The render room has NO global illumination or skylight, this is a render of no lights whatsoever on the scene, simply the reflections from the hdri. You'll notice the cube is completely black as there is no light falling on it, but despite there being no light, the sphere reflects perfectly well the background, including the little black box of the unlit cube.

    blurry_1.png
    900 x 506 - 344K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    I also rendered in layers as I experimented, here's the reflection map for the first render, you'll notice that while everything else is black we get a nice crisp reflection on the sphere of the hdri map (and since the black lightless cube is within that environment, we can see that in the reflection as well). Again, this is with NO lighting. This shows that reflections require no light calculations, and instead only require something to be lit in the surrounding area for the reflections to reflect, which is a really cool fact that can help us down the road.

    blurry_1_reflection.png
    900 x 506 - 46K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    Let's try something new. I want the cube to be more than a black void in the reflection, so I'm adding a 100% glow to the cube's texture.

    blurry_2.png
    900 x 506 - 344K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    Excellent, now instead of a black cube I've got a white cube. Since I'm not using global illumination, the glow channel for the cube does not radiate any light in the scene, it only makes the cube glow, nothing more. But the fact that we can see it glowing in the reflection is salient. Here's the reflection channel for that render:

    Blurry_2_reflection.png
    900 x 506 - 46K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    Ok it works with no lighting to give good crisp reflections, which is great news. Heck it will render this scene much faster than a second, and closer to instantly. But will it still work with blurred reflections? Well, let's click the dreaded box for blurred reflections and find out...

    blurry_3.png
    900 x 506 - 336K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    It seems to work just fine with blurred reflections, still nearly and instant render (maybe ever so slightly slower than rendering unblurred, but still so fast it's blink-and-you-missed-it). And here's the reflection layer:

    blurry_3_reflection.png
    900 x 506 - 40K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    So we can see that blurry reflections can render quickly, and aren't light dependent but instead simply rely on the brightness of objects in the surrounding area.

    But wait a minute, now I'm wondering does it make a difference if there is light in the scene? Let's do a render of this scene with skylight and global illumination on, now the hdri and to a slight degree the glowing cube should add a little light, and let's see if the extra light makes any difference to the reflections. Here's a render with it unblurred:

    Blurry_5.png
    900 x 506 - 341K
  • JonstarkJonstark Posts: 2,738
    edited August 2014

    And the reflection channel:

    blurry_5_reflection.png
    900 x 506 - 46K
    Post edited by Jonstark on
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    and here's one with blurred reflections:

    blurry_4.png
    900 x 506 - 334K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    and the accompanying reflection channel:

    blurry_4_reflection.png
    900 x 506 - 39K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    Well we can see that the sphere itself in the main render is brightened up some by having actual light hitting it, since I left the sphere with the default gray color of a primitive now that light is actually illuminating it, it makes the sphere look more grayish in the scene instead of giving a straight reflection. But the extra light only affects the sphere in the primary render, it doesn't make the hdri any brighter, and the cube was already glowing at 100% so if the cube is any brighter in the reflection it's impossible for my eyes to detect. So adding lights to this scene doesn't really seem to change the reflection channel layer at all... and actually this is a good thing, as it seems to indicate if we do one render with full global illumination for an hdri scene with no reflections, and then do a render pass without global illumination for blurry reflections only, and then combine them in layers, we should get exactly the same result than if we did a full GI render with blurry reflections and waited umpteen thousand hours for the render. Excellent shortcut, same results! Suddenly blurry reflections are within our grasp!

    But wait, this method will work fine with scenes lit by hdri backgrounds, but what about regular old Carrara scenes we've assembled, which don't use hdri backgrounds? Well, let's find out...

    Here I've loaded a bedroom scene that is completely enclosed with no hdri light in the background. The camera, sphere and cube are all inside the bedroom, here's a render with no lights whatsoever:

    blurry_6.png
    900 x 506 - 2K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    Well dang it, that didn't work too well. The only thing we can see is that glowing cube, and the reflection of the glowing cube in the Sphere, since the sphere is still set to 100% reflectivity.

    But wait... what about that ambient light setting? Suppose we were to hike that back up from 0% to let's say 50%? That would make the room visible, and therefore should be visible in the reflection settings, right? Let's try:

    Blurry_7.png
    900 x 506 - 257K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    And here's the reflection channel for that one, in which we can see the surrounding room is reflected nicely.

    Blurry_7_reflection.png
    900 x 506 - 23K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    Change the sphere back to blurred reflections we can see we're getting the same results we would expect, all at lightning fast speeds:

    blurry_8.png
    900 x 506 - 254K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    and here's the reflection channel for that as well:

    Blurry_8_reflections.png
    900 x 506 - 20K
  • JonstarkJonstark Posts: 2,738
    edited August 2014

    Of course the lighting for the room is awfully flat and completely even, and while this doesn't matter a whole lot if all we are after is the blurred reflection channel to add in as a layer to our first global illumination high quality render, let's see what happens when we strip out the ambient lighting, add in a couple of bulb lights (one overhead and one over the lamp near the bed) to give more depth and light variation to the rooms, and thus to the reflection channel (this is horrible lighting, but who cares, it's just a test to see) . Rendering it again with no GI or Skylight, just a straight render:

    (edit might have to finish this at a later time, seems there's a cap on the number of posts and renders I can post... I was so close to the end too... )

    blurry_9.png
    900 x 506 - 335K
    Post edited by Jonstark on
  • HeadwaxHeadwax Posts: 9,987
    edited December 1969

    great stuff JonStark, thanks for sharing :)

  • JonstarkJonstark Posts: 2,738
    edited August 2014

    Finally letting me post more. Here's the reflection map for the last one:

    blurry_9_reflection.png
    900 x 506 - 22K
    Post edited by Jonstark on
  • JonstarkJonstark Posts: 2,738
    edited August 2014

    Now we're getting a blurred reflection at a lightning fast speed that mimics the light variance in the room. Cool!

    But hey, will this really equate with a blurry reflection in the same scene and lighting setup, that has Global Illumination? Ok let's find out, same scene but now with Global Illumination set to 100% (by the way, every render up to this one was a matter of much less than a minute, but with full global illumination, even on this very simple scene, it was a 13 minute render, thus illustrating the problem using blurry reflections and GI at the same time):

    blurry_10.png
    900 x 506 - 452K
    Post edited by Jonstark on
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    And here's the reflection channel:

    Blurry_10_reflection.png
    900 x 506 - 28K
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    So comparing this to the blurry reflection channel that was done with no global illumination, the main difference I can see is the brightness level is higher, otherwise it looks the same. Which should mean if we simply kick up the light intensity for the 2 bulb lights some, we should be able to get similar results in a tiny fraction of the render time, so I doubled the intensity of the 2 bulb lights to see and rendered, again with no GI, just a straight render:

    blurry_11.png
    900 x 506 - 389K
  • JonstarkJonstark Posts: 2,738
    edited August 2014

    and we can see from the reflection channel

    Blurry_11_reflection.png
    900 x 506 - 27K
    Post edited by Jonstark on
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    that it's pretty dang close, the main difference is that the GI version has a color bleed from light bouncing around the walls, and the non-GI version doesn't. For purposes of the reflection channel, and using it as a layer to a full GI render, this slight difference will be undetectable. Still if your OCD side comes out and you just have to have it absolutely precise, coloration and all, then one solution might be to make a spherical render of the scene with full GI and no reflections, then use that spherical map as a background and render the scene with reflections enabled and the surrounding scene objects invisible, that should theoretically work I think. I don't know how to do it, but I think it's possible to make an hdri from a spherical Carrara render (maybe someone could make a how-to thread for this?)

    Anyway, in conclusion, if you've got Carrara Pro and can render in layers, then you can get some super nice and accurate blurry reflections, even for your highly detailed global illumination scenes, simply by rendering the reflection channel separately and then adding it to your GI render in postwork. So why wait for 17, 25, 40+ hours for your render to complete, when you can accomplish the same results in only minutes of rendering?

    Also, because I didn't know how to do it initially and had to slowly figure it out, here's the step by step on taking a reflection channel and turning it into a transparency in GIMP.

    1 of course open Gimp
    2 of course open your reflection channel image
    3 Select Layer
    4 Select Transparency
    5 Select Color to Alpha
    6 click in the 'From' color box and then drag until you've selected it to utmost black
    7 now it turns it into an alpha, so select Edit and copy visible
    8 open your primary image you want to paste the alpha on top of
    9 select Edit and then Paste

    This is probably dead easy for anyone else, but since I'm kind of post-work impaired and it took me a while to figure out, I thought I would mention it :)

    So hopefully this will be of some help to others, thought I would share my current approach to using blurry reflections, which I feel can be a very important part of making your renders really look great. I don't think we should have to do without blurry reflections, and I don't think we should have to suffer through ridiculous render times to get them :)

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    Any image you put in the scene's background will act as an IBL if you use the skylight option in the render room. You just won't have the same dynamic range, but it does still look nice.

  • PhilWPhilW Posts: 5,145
    edited December 1969

    Some great ideas and creative thinking in this - I'll have to give it a try! Incidentally, if you are just using an HDRI and don't have much of a physical environment around your object, you can try hiding all your objects and rendering to give an image that you can put in the backdrop, and then by blurring the HDRI map you get blurred reflections without having to use the actual blurred reflections rendering.

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    PhilW said:
    Some great ideas and creative thinking in this - I'll have to give it a try! Incidentally, if you are just using an HDRI and don't have much of a physical environment around your object, you can try hiding all your objects and rendering to give an image that you can put in the backdrop, and then by blurring the HDRI map you get blurred reflections without having to use the actual blurred reflections rendering.

    Phil, I assume you mean to render a spherical image and then blur it and put into the background? If you do that, could you render the reflected objects in the scene with the spherical camera and also a depth pass, and then use your image editor to add a DOF in the editor, then put that image into the background. The near objects should then appear in focus and the further objects would become blurrier? Or would that take to long to do, do you think?

  • PhilWPhilW Posts: 5,145
    edited August 2014

    I was more thinking that if there aren't a lot of foreground objects, blurring the HDRI background looks pretty much the same as rendering a sharp background but with blurry reflections, but the latter takes a lot longer. The downside is that you are also blurring the visible part of the HDRI map that you would see in your image. So if you hide your objects and render, you will capture the part of the HDRI which is visible and use that as the Backdrop (not Background) before substituting a blurred version of the Background. Reflections of any other foreground objects would still be sharp though.

    Or you could just render the whole thing in Octane Render for Carrara, where you pretty much get rendered depth of field and blurred reflections as part of the deal without a huge render cost!

    Post edited by PhilW on
  • JonstarkJonstark Posts: 2,738
    edited December 1969

    I don't think it would work the way you're thinking, though I'll have to try it to see for sure. Part of the blurred reflections is that they have a much wider 'spread' (but weaker) on the object that's using the blurred reflections. I think you would get a crisp reflection of a blurry image that way, which isn't quite the same effect. Have to test it to see

  • JonstarkJonstark Posts: 2,738
    edited December 1969

    Btw, am I wrong in thinking that Carrara can create a spherical hdri map?

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    Jonstark said:
    Btw, am I wrong in thinking that Carrara can create a spherical hdri map?

    Carrara can make spherical renders, but I think the renderer can't output an image with enough bit depth. I may be wrong on that.

Sign In or Register to comment.