Monthly Archive for July, 2008

Lightcuts: week 9

Textured area lights turned out hugely popular, so now it’s hard to live up to expectations I guess!

This week’s work was indeed far less exciting: I worked on supporting more material features, as so far only lambertian diffuse and phong specular where supported. Now, all diffuse shaders are supported.

Every single shader must be specifically supported as we need to be able to answer this question: what’s the maximum value that a specific pixel, shaded this way, may assume over a bounding box of point lights? You don’t really need the exact maximum value, so a ridiculously large number would always be a “viable” answer. On the other hand, you want the bounding value to be as tight as possible, because if the error turns out to be very low, you may decide to skip all the lights further down in the light tree, thus saving rendering time.

I also added support for all falloff types (except custom curve falloffs). The default falloff type for Blender lamps is “inverse linear”, while only “inverse square” was supported so far: this could lead to very incorrect renderings, especially when testing existing scenes.

Now, for instance, this hangar scene (featuring a lot of dupliverted “inverse linear” point lights plus a couple of additional area lights) looks a bit better:

Tree creation time:     00:02.27 Number of (point) lights: 3841 (1476l + 0s + 2365o) Requested error rate: 0.020 Average cut size: 239.44 Shadow rays: 233.08 (6.07%)

Tree creation time: 00:02.27 Number of (point) lights: 3841 (1476l + 0s + 2365o) Requested error rate: 0.020 Average cut size: 239.44 Shadow rays: 233.08 (6.07%)

Hangar (False colour)

Hangar (False colour)

(Thanks Gillan for pointing me to this model).

◊ ◊ ◊

On the textured area light side, Italian Blenderhead Lusque has performed an interesting experiment. If you bake direct lighting coming from a light source (e.g. an area light) onto the walls of a Cornell-like box, and then you use the baked textures as textured area lights, you basically have a simple indirect lighting pass.

Here you can see a test, where the indirect lighting has been exaggerated on purpose:

I’ll post Lusque’s blend file here as soon as we sort the remaining issues out.

(Please note that this is just an experiment and that it has nothing to do with the “Instant Radiosity” scheme I would like to implement; I am also perfectly aware that it has limited applicability, but it’s still very clever in my opinion).

Textured area lights in Blender

One of my favourite pictures from the original Lightcuts paper is an office scene lit exclusively by a tv screen. You can do that with textured area lights.

In Blender you can already link a texture to a light, but the outcome is a sort of texture projection, which is useful if you want to fake effects like light passing through a tree without actually computing the visibility: that comes of course very handy for cutting rendering time, to have artistic control on shadowing, etc.

What I mean here with textured area lights, on the other hand, is actually modulating the color and intensity of the light throughout its area. This way you can obtain the effect of lighting coming from tv screens, large windows with varying lighting conditions, and even area lights with custom shapes. Here are some examples.

Textured area light

Area light with custom shape

Tv screen

In the lightcuts paper you had also the added contribution of indirect light. In this case I added some additional lighting using a faint environment map. The interesting point to note is that putting additional lighting has a negligible impact on rendering time, if not a beneficial effect! This is because completely occluded areas evaluate far more lights than bright areas, as a consequence of using a proportional error metric; thus, having those parts brighter allows for less evaluations.

Here’s a false colour rendering where the green areas show where the environment lighting is more influential and the bluish areas show where the area light is more influential. The red channel counts the number of lights used with respect to the maximum, so the image is white where it’s most occluded, as expected.

Textured area light (false colour)

GSoC: midterm evaluation

Apologies for not having updated my blog recently. There’s quite a lot of stuff I have yet to blog about and I’ll surely do that in the near future. This week is halfway through the Summer of Code and it’s midterm evaluation time. Having been scolded for the lack of coolness of my rendering tests during the last developer meeting, I took the time to grab some better looking model and arrange more interesting tests. You can find my midterm report, together with said renderings, on Blender’s wiki. A warm thank you to the Kino3D guys who helped a lot in the process.

By the way, as a SoCer I got to visit Google’s London office today. I was glad to have my Blender t-shirt handy for the circumstance. During the tour I’m pretty sure I saw a couple of guys editing a video using Blender on an enormous screen. Overall the visit was very inspiring and, you know, a free lunch is always welcome!