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:
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?