SmartReLight – relighting with Pixel Bender
27. December 2009 – 17:57Tags: Normals, PixelBender, Relighting, SmartReLight, Video post
Relighting is an interesting method that is often used in video post production pipelines.
Given the vector of its surface normal, it is possible to calculate the brightness of each pixel by a pseudo 3D lightning system.
Checkout the demo of SmartReLight!
As the ‘object space’ – or ‘material’ normal’s have to be known, relighting is mostly used within the post process of CG generated images or videos.
It’s a convenient way to archive great lighting and gives the artist most control as he can tune it in real-time without having to re- render the footage for every adjustment.
As you can see from this example, the complete lighting is done by the shader using only a color pass and the object normal’s:

This implementation is fairly simple as it doesn´t support reflections and refractions like Normality , but its fast and does the job – and what better way to get through the last cold days of the year than playing half an hour with Pixel Bender?
It’s also possible to relight already lighted sources to some extend, by not using the color- , but an already phong- shaded pass:
You can download SmartReLight here and the source of the demo including the shader here.
Compiling PB shaders at runtime
Last but not least a short but very interesting story:
Recently I was asked if it was possible to compile a PB shader at runtime.
Given it some thought – why not?
And as it turned out the hell of a chap Nicolas Canasse already took care of that matter.
There is also already an AS3 port by James Ward.

4 Responses to “SmartReLight – relighting with Pixel Bender”
Great Example- Lot’s of other interesting experiments too. I’m a fan
By Peter Strømberg on Jan 6, 2010
Hi Peter,
thank you for the complement.
Great stuff on your page too – I see you also worked with relighting.
Consider yourself bookmarked
By flashgordon on Jan 6, 2010
Just stumbled across your site by chance – fantastic!
Really like this use of pixel bender.
By Mike Almond on Jan 12, 2010
Thanks Mike,
and btw – love the idea of a simple font-asset creater!
By flashgordon on Jan 12, 2010