Archive / Month / October, 2009

As some of you may have seen, yesterday during the 2009 Blender conference keynote, Ton Roosendaal announced the addition of another full time blender developer: me! Thanks to the support of a very generous anonymous sponsor, I should be able to survive working from home on Blender development for the next few months.

This came about over the last week or two, so it’s still new for me as well. As far as I’m currently aware, the brief for this project is ‘Get Blender 2.5 ready’. So rather than some of the other things I’ve been working on in my own time such as volume rendering, at least in the near term, this project will involve a fair bit of ui work, fixes, tweaks, cleaning up, attacking the 2.5 todo list, documentation – attacking the main things needed to get the 2.5/2.6 work polished to a professional level.

I also hope to be able to provide support to other developers who are working on other tools, to help polish things for 2.5 where they may not have time to do so themselves. This also includes Brecht and Campbell at the Blender Institute who are busy with Durian – I suspect I’ll be taking on some of their grunt work, so they can concentrate on what’s needed for their production. Hopefully this can alleviate some of the ‘blender open project syndrome’, where features are added quickly to fill a specific need for the team, but aren’t entirely well integrated or fleshed out enough to be fully useful for blender users in general.

So that’s the plan as it stands for now. Depending on how soon these tasks can be done, perhaps there will be time for some other things such as working on python integration related work, render api, or also something I think is desperately needed – design and coding work for a re-written shading/material system. But time will tell!

We recently finished a cg sequence for ‘Klaas Vaak’, a European children’s TV show. The show’s about the Sand Man (Klaas Vaak), who tells stories and illustrates them with sand drawings, and it looks really fun. We did a 30 second intro sequence and 10 second end credits sequence. The character’s owned by a large theme park, Efteling, and as I understand, some of this stuff will be constructed in real life at the theme park – very cool.

As usual, I did lighting/shading/comp, and some modelling and fur work too. Jeremy Davidson did most of everything else – animation, rigging, particles, etc. In general it went pretty smoothly, although some of the bigger shots full of trees and houses caused some headaches with the amount of geometry. Especially since at the start of the project we were using 32bit systems to render, though we ended up moving to 64bit midway. Only the first few visible ‘layers’ of trees are geometry (well even still, geometry with branch alpha mapped image textures), but after that, much of them are either image planes with baked colour/normal/alpha maps. All in all though, I’m pretty happy with how it turned out.

It’s been a little while since I merged the volume rendering work into Blender 2.5 but I’ve been steadily poking away at it since. Today I committed some lighting features, support for volumes receiving external shadows (raytraced, and quick but more limited shadow mapped) and a new shadow only mode that’s a bit faster than self-shading, good for less dense volumes like fog or wispy smoke:

I’ve also had some behind-the-scenes help in the form of code review and some new features from Alfredo de Greef, which has been great, and last week I bit the bullet and redid part of the shading code. It was previously using a custom method left over from initial experiments that wasn’t entirely physically correct – the shader didn’t conserve energy. In the real world, if more light is scattered out of the volume, towards your eye, there will be less left to keep penetrating through the remainder of the volume, but the previous method didn’t account for this.

In reality this also applies on a wavelength-dependent basis too, if the media is such that the red light is scattered out of the volume (from an initial white light shining on it), all that’s left to continue through the rest of the volume is the inverse of that (roughly cyan). I got to work changing this in the code, but after a long time testing realised it was getting very difficult to control. Most of the time, if you’re making a coloured volume (like the excellent coloured smoke in the Cloudy trailer), you want to be able to just set a colour and be done with it. Doing it by tweaking wavelength dependent absorption and scattering was getting to be a real pain, so I ended up chopping and changing things around.

Now there’s a single physically based ‘scattering’ parameter, controlling the amount of light that’s scattered out of the volume (leaving less to continue through), as well as a ‘transmission colour’ that defines the result colour in the rest of the volume, after out-scattering and absorption. With these settings, by default, the shader works physically correctly. For ease of control though, I also added a ‘reflection’ colour and strength which basically acts as an RGB gain, tinting the out-scattered light. It’s more of a non-physical tweak, but it does make life a fair bit easier. I’ve documented these settings with example renders on the blender wiki.

I’m pretty happy with how it’s working now: physically correct by default, but with the option of changing it for artistic control, and philosophically I think that’s how it should be. One of the many things I dislike about Blender’s current shading system is that it generally starts out incorrect, and you have to really understand what’s going on, and work quite hard in order to make it do the right thing (energy conservation, obeying physical laws, etc.). Not only is this a real pain since you have to go through the same chores every time just to get a decent looking material, but for many people who don’t have a good understanding of how rendering/shading works (or should work!) they’re left with sub-par results since they don’t know what magic buttons to press. You should have to work to break it, not to get just a base level of correctness. In further work I do on shading/rendering, that’s going to be a large motivation, to get things working physically plausible by default, but with the ability to break the rules if the situation requires it.

|