web log

Last week, Lighthouse was released online, a short film project that our studio had been working on for the last couple of months. The full details about the project, with the movie itself viewable online, high res stills, and production breakdown video are available in the post we made at CGTalk, so please do go and check it out there. The response so far has been great, we got featured on the front page of said website, and have had several thousand views with very encouraging comments.

Although it was a bit tricky for me, being the bottleneck responsible for the texturing, shading, lighting, comping, with a couple of weeks of late nights towards the end of the project, it was quite enjoyable overall. Exopolis, our clients in LA, were fun guys to work with and gave us a lot of room to work without being micromanaged. It’s interesting that Liberty Mutual (the insurance firm who commissioned the work, in the form of the ‘responsibility project‘) are now spending their marketing dollars on producing themed art, rather than usual commercials. It’s certainly the kind of work I’d love to be doing more of.


Since there’s no analogue built in to Blender at the present, during our last animation project, I knocked together a very simple PyConstraint: Noise. It’s made to fulfill similar tasks as the Noise controller in 3DS Max, giving random (yet deterministic) animation to an object. We used it for things like like applying it to a lamp for randomised shadow flicker from a candle flame, or on a large scale, subtle swaying movements of a ship on the ocean.

There’s a thread with instructions on blenderartists.org, and the goodies themselves here:

Things have been busy lately. There have been plenty of ‘real life’ things to take my attention from this site - some of them fun, like moving into a new place with Kat, some of them not very fun at all like having the place broken into and robbed a month later.

Work’s been spread on thick. Last weekend, we reached the finish line of a project we’ve had on over the last 2-3 months, a 2 1/2 minute short film that we’ve been creating for a production studio in the US. The work has been very fun and artistically interesting, the clients have been great, and we’ve all learnt a lot in the process. The only down side for me personally has been the amount of overtime I’ve put in to try to keep it looking nice, after shouldering most of the responsibility for the texturing, shading, lighting, comping, some of which has been kinda complicated. I really can’t complain at all though, it’s definitely my favourite kind of work. The public release should be quite soon, so keep an eye out!

As part of the project, alongside the many hours of artistic work, we’ve also done some development work. A few of the shots required an ocean environment, and since the existing methods of displacing clouds textures weren’t really adequate, we contracted Hamed Zaghaghi to develop ocean simulation tools in Blender. He’s done an excellent job, integrating a new ‘ocean’ procedural texture, which can be used not only as a displacement height map, but also with various shading modes for layers such as foam masks. We plan to get a patch out early net week.

Another sequence of shots involved an old, thick lighthouse lens. In many of the reference photos we looked at, they showed quite strong chromatic dispersion, so as a side project I started to work on raytraced dispersion rendering in Blender’s internal renderer. After getting a bit stuck mid-way, I had a look through yafray’s source code, and found some spectrum code that was just what I needed, and it integrated nicely. Thankyou yafray, and thankyou open source! I’ll try and get a patch for this together soon enough, too.


Ocean sim Raytraced dispersion

I’ve just updated the website for the studio where I work and put a bunch of somewhat recent work up, so I thought I might show a few of the commercial projects I’ve been working on lately. A lot of the interesting work has been illustrations, but recently we’ve just finished an animated TVC for Bridgestone which has just gone to air here in Australia.

The others had done a few similar ads with the gecko in Max before I started working here, but since our animator is becoming more familiar with Blender, especially due to the nice animation tools we have now, we decided to have a go doing this one in Blender (everything except modelling, which came out of Max). I was responsible for the lighting/shading/rendering.


The final animation (3MB QuickTime).

Here’s some other recent work that I’ve been involved in, too:

Had some r&d time lately, at work and at home. Here’s what I’m up to:

I’d like to get the node system hooked up to raytracing, allowing one to do advanced shading techniques but without being forced to do it with the dodgy ‘mixing materials’ method. As a starting point, I’ve made a reflection node - the bonus is that the node system makes it a lot easier to texturise inputs. Thanks to some hints from Alfredo de Greef, I’ve added an additional input to rotate the anisotropic direction (with black being 0° and white being 360°). This can give some nice effects:

I’d also like to include a refract node, an AO node, and/or also a general purpose raytrace node that takes a •vector and •solid angle as input, and gives as output: •whether it intersected something (average of samples in solid angle) •distance to intersection, •shaded colour of intersected face, etc.

At the studio we might possibly be doing a project that would involve vfx/image based lighting. It’s Christmas soon and there are plenty of shiny balls around, so I got a nice one and we’ve started making some HDRI light probes. Blender’s brute force method of doing image based lighting by evenly sampling the hemisphere in AO gives reasonable results, but it’s too slow for animation.

I’ve been looking into a technique originally devised for realtime graphics, based on the paper An Efficient Representation for Irradiance Environment Maps. It works by storing the irradiance in the map in spherical harmonics coefficients and only supports lambert diffuse shading, but it’s extremely fast, and can give quite nice results especially combined with it in an AO source, or even just humble buffer shadows. I’ve done some tests so far with Paul Debevec’s free light probes


Three months since the last post here, I think that deserves either an award or a slap on the wrist. Things have been busy, and I’m sorry to say I’ve been much more inclined to spend my free time in other ways than writing here.

Work has been through alternating bursts of slow r&d time and busy projects, the latter being where I find myself at the moment. We’re using Blender more and more, currently we’re doing an immensely complex animation of around 12,000 frames, without much time to do it in. It’s the first project of this scale that we’ve done in Blender as a team, and although it’s a lot to manage and keep track of, it’s been pretty good.

Blender’s linked library / group / scene / action system has been great, and much easier than they were doing previously for similar projects in Max. I’m keeping a master scene file that contains everything, however most of the models/rigs in there are coming in from linked groups in external files, that any of the others can add to and update. Not only does this keep things easy to modify and ripple through, but it allows us to distribute the workload well between all of us by segmenting the files finely. I’m afraid I can’t give much more detailed info at this moment, perhaps some time in the future.


The work I was doing on glossy reflections/refractions was finished a while ago, the end product being much more robust and advanced than in that last post, and also including all sorts of extra nice things like using QMC sampling for ray shadows and ambient occlusion. These changes are now officially in Blender’s SVN repository and will be in the next major release, however I’ve already been making use of it extensively. This not overly interesting illustration I did for a magazine cover made it into the Australian Creative magazine gallery and uses a lot of anisotropic blurry reflection.

I made some nice docs online here: Glossy Reflection/Refraction / Raytraced Soft Shadows / QMC Sampling. Thanks again to Brecht van Lommel and Alfredo de Greef who both gave me some great guidance and help along the way, and I look forward to doing more work in this area in the future. A few other changes I’ve made recently have been extra lamp falloff options, including custom curve, enabling different curve tilt interpolation types, and I’ve also committed a bunch of ex-tuhopuu UI related work to the ‘imagebrowser’ branch, to work on separately in there until I can find the time to finish it up and bring to the main Blender SVN trunk.

But life goes on…

Previously, I’ve grumpily complained that there aren’t enough people interested in working on Blender’s internal renderer, and so it was only fair that I put my money where my mouth is. I mentioned I’d been doing some coding recently, and this is one of the products of that time: blurry/glossy reflections and refractions in Blender’s internal raytracer. It works similarly in concept to yafray’s ‘conetrace’, sampling a cone of rays around the current pixel to get an averaged, blurry result. The sampling is using a quasi-monte carlo Halton sequence, which Brecht van Lommel previously converted into C code in an old experiment of his, and which he gave me a lot of valuable help with - thanks a bunch, Brecht!

This has been quite an interesting (though sometimes frustrating) learning experience for me, diving into a new area of Blender’s source code for me, and learning about many concepts I was previously unfamiliar with. What I’ve got so far probably isn’t perfect, but I’m very happy with the progress made so far. I’ll post again soon about some of the process and things I’ve learned so far, hopefully in a way that people not used to reading technical SIGGRAPH papers will get some value from. But for now, here are some pretty pictures, and a patch! There’s also a bit of discussion in this thread on blenderartists.org, too.


Blurry reflections Blurry refractions

It’s been a while since my last post here, I’ve had a few things going on that took priority. Kat’s been very sick and I’ve been spending most of my available time over the last four weeks at the hospital with her. It’s been exhausting for all of us, but she’s now recovering well and going home in a matter of days, which is a great relief.

Work has been going quite well, with bursts of very busy periods interspersed with down-time. I’ve barely needed to touch Max and have been working in Blender just about all day every day, with some compositing in Fusion every now and then.


The others have been learning Blender too, and getting great results very quickly. Unfortunately there seems to be very little educational material that’s really suitable for experienced artists who already know what they are doing, so it’s been very helpful to have me on hand to point things out, translate terminology, show where things are and point out the inevitable stupid gotchas and idiosyncracies (which I’m always trying to eliminate).

Although I do nearly all my work in Blender, we’ve also tried doing one small commercial project using Blender as a team, which went very smoothly. We also had a lot more experience working in it together a short while ago, where in a week without much work scheduled, we made a short 30 second animation for fun and practise. I’m quite happy with the quality of it, especially considering the others had only been using Blender for two weeks and we only had a week to make it from scratch. There are still a few shots I’d like to re-render over the coming weeks when the render farm’s idle, so hopefully we can post it somewhere to show soon.

I wish I could post some of the things I’ve been working on lately, but I’m not sure what’s out in the open now or not. I can show one of the earlier things I contributed to though, which was the background/set for this raccoon illustration. The trees were lots of fun to sculpt from scratch in Blender, and the raccoon itself was made (not by me) in Max/VRay, with a fair bit of retouching in Photoshop. I’ve also been spending some time coding in r&d time at the studio, or while hanging around at the hospital, but this post is long enough already so I’ll try to show the results of that work soon.

Over the last few weeks at the studio I’ve been working in Blender alongside 3DS Max and I’ve needed to export 3D bézier curve (spline) data between the two apps. There were a few occasions, such as exporting a logo that I’d cleaned up in Blender from a 2D SVG, and also some 3D animation paths that I’d been working on. While there are a lot of options for exporting other data such as meshes, there’s very little around to facilitate transferring 3D curves between packages.

Wavefront OBJ is supposed to support curves as part of the spec, but functionality is extremely limited, and it’s so rarely used that I can’t find any apps or plugins that actually bother to support this area of the spec. I read somewhere that Autodesk’s flagship format FBX is supposed to include curve data, but in my tests, neither Max or Maya would export curves to FBX anyway, so it looked like they just didn’t bother support it. This makes it a no-go regardless of whether the up-and-coming FBX exporter for Blender supports it or not.


So with no ready made options, I tried an idea - I read up on MaxScript and made a Python script for Blender that takes the curve data and and uses it to generate a MaxScript, that when run inside 3DS Max will generate the same curve using the MaxScript API. There are a few advantages to this, there’s a very fine level of control and you can easily export every feature that’s supported by both Blender and Max, without worrying if an intermediary format supports those specific features too. However there are drawbacks - it’s a pain to use since you have to open up and run a MaxScript each time, rather than just importing a file. I’d rather support an existing standard format, so it’s more widely useful for other people than just me.

I’d been using the ColladaMax plugin (based on the open source FCollada library) previously to transfer meshes and cameras between Max and Blender, and after doing some more research it turns out that the COLLADA format supports 3D béziers, as does ColladaMax. Neither of Blender’s two COLLADA exporters do though, and they seemed too complex for me to add curve support to them, so I grabbed the spec and threw together my own simple exporter for curves only. One very annoying issue is that the ColladaMax plugin (and I presume the FCollada library) expects the data formatted in a way that’s incompatible with the spec. Since my goal here is practicality rather than technical purity, this means that rather than it being a generalised COLLADA format exporter, I have to tailor it to FCollada’s non-standard idiosyncracies. I hope the library is updated to conform to the standard in the future, but going by the devs’ response on their forum it doesn’t look like that will happen any time soon. On the positive side, there’s a good chance that my exported COLLADA curves will work with the ColladaMaya plugin as well, opening up another application to work with. If anyone can test this and confirm or deny, that would be very interesting information.

Anyway, the script is available here: export_curves_fcollada-1.1.py. It’s my first exporter and I didn’t use any fancy XML libraries, so it may be rough (although it gets the job done fine). If any Python gurus have ideas on how to improve it, I’d appreciate some hints! I hope this post might help anyone in the same situation as me, in the ever-perilous business of interoperability.

I thought I’d quickly share a less conventional usage of some of Blender’s newer features that’s been sitting around on my desktop for a while now. A few months ago, it was (my girlfriend) Kat’s birthday and I thought I’d have some fun and make a simple pop-up card, rather than just buying one. Of course after thinking about it for a little while, my curiosity got the better of me and I set about to make it in CG.

It’s just a simple tree, based on the design of a ring of hers. I traced the shape, making sure it was kept in two flat halves, unwrapped it, and sculpted on a bark-like surface. Then, I added a plane with a dirt texture, added some grass, and set up some lights. From there it was just a matter of doing a full render bake to texture, leaving me with a grass image from above, and the unfolded, textured tree. I saved out the baked textures, printed them on to card, cut them out with a scalpel and wrote a message. I had no idea if it would work or not, but I think it came out all right in the end.


sculpting baked textures printed and assembled

Unfortunately, ever since their inception, modifiers in Blender haven’t let you animate their settings. This is a real pain, and a motivational hurdle against people making lots of nice new modifiers like ‘bend’, ‘twist’, ‘taper’, etc. I really hope this gets addressed soon, but until then, here’s an ugly workaround which will let you animate modifiers using the bPython API.

Basically, you need to create a dummy object that you will animate in a simple manner just so you have an editable Ipo animation curve. From there, use a scriptlink set to onFrameChange to read that Ipo and manually set the modifier paramater you’re interested in to the curve’s value at that point in time. You can download my demo .blend file to see how this works (remember to enable script links in the scripts button tab), or check the demo video below to see an animated Decimate modifier.



Animated Decimate modifier

A while ago, I did some experiments that I didn’t really show anyone, a proof of concept for generating non-destructive primitive objects through the modifier stack. One of the things I liked in recent dabblings with 3DS Max is having flexibility and realtime feedback when editing primitive objects, and I thought I’d see if I could make it work in some way in Blender.

The issue of being able to see and tweak the effects of what you’re doing is one of the things that frustrates me most in Blender and I had a bit of a rant about it at last year’s Blender Conference. The topic came up on the bf-funboard list today, so I might as well share it here too:


It’s basically using a modifier at the bottom of the stack to create geometry, which you could then just apply to edit the mesh directly, though that’s not always necessary. This is a bit similar to how Max and Cinema 4D work. When you add an object, you can still manipulate dimensions, resolution, other parameters as a whole. Then if you want to edit it manually, you convert it to an editable mesh with a click.

Grid Star

Above are some screencasts of what I did in Blender. Obviously it’s simple and rough, and if developed further, one could do things to clean it up like disable those generator modifiers from appearing in the menu, change the add object code to apply the generator modifiers automatically, prevent them from being moved up and down the stack, and perhaps add some code that upon pressing Tab, would give you the option to apply that modifier and just convert it to a mesh so you can edit it. In any case, this could serve as some kind of inspiration for something nice in the future…

I came across an article yesterday which referenced a presentation at SIGGRAPH 2004 by ATI, talking about a quick method for faking subsurface scattering in skin and had to give it a try in Blender. It’s by no means accurate, but it’s very fast and easy to set up now in Blender. The technique is apparently what they used on the Matrix: Revolutions ’superpunch’ shot, it’s basically using UV information for finding pixel locations on the surface, by rendering a baked image of the lighting and blurring it.

Luckily, with the baking tools now in Blender, this is simple. Just set up your unwrapped model so it’s rendering as usual [1], give it a new image texture and do a Bake Render Meshes → Full Render, to get a baked image of that lighting information [2]. When you do this, it’s important to set the baking bleed margin high [3], so when you blur this image later, you don’t get the black background spilling back into the visible area.


basic render baked lighting to the UV map margin bleed setting

[1] Basic render

[2] Baked UV map

[3] Margin settings

Now just load that image up as an image texture on your model’s material. You can do this without saving or packing the image since it’s still in memory, but if you don’t, it’ll be lost when you next load up that blend file, so you might as well save it. The next step is to blur this image, to fake the light scattering around under the surface. You can do this in Photoshop or something, but the easiest way is to just raise the ‘Filter’ value in the image texture [4]. This sets the width of the sampling area for when the pixels are looked up during texture mapping, and is pretty much the same as blurring the image. Switch on ‘Gauss’ to use Gaussian filtering instead of the box filter. Gaussian is much softer and doesn’t leave stepping artifaces with large filter sizes like Box does. It can also help to switch off MipMaps, though this will slow down the render as a tradeoff.

Finally, you’re going to be using this image texture to provide the lighting on your object, so first turn down your diffuse shader’s reflection value (usually ‘Ref’), give this texture a UV mapping, and turn up ‘Emit’ so the material is self illuminated by the texture. There are a few ways you could go about this such as mapping the texture to affect the ‘Ref’ channel, but what I’ve done in these examples is to turn down Ref to about 0.15, Emit up to about 0.85 and map the texture to the Color channel.

Render, and there you have it [5]! I gave it a try on my recent sculpt model, and it looks interesting there too [6]. For some situations, this works just fine, but it’s only really practical for things like skin, since it’s just blurring. It won’t handle real translucency, like light coming through a leaf.

Image texture filter settings Suzanne with fake SSS Effect applied to a sculpt model

[4] Filter settings

[5] Suzanne rendered with the effect

[6] Applied to a sculpt model

The good thing about this technique, unlike the toon shader/shadow buffer method, is that it lets you use a standard lighting and material setup. This technique isn’t view dependent, so it will be fine in animations like flyarounds, as long as the model or light sources aren’t moving. Perhaps it would be possible to get it working in animation by means of a script - i.e. for reach frame, do the bake render, and since you’re already using that image as a texture, it should go fine. Of course this is still a cheesy hack, so bring on the real thing!