Painting CG Scenes with Light

Making my dream lighting tool a reality

No more placing 3D lights manually. No more figuring out the ideal position just so reflections are positioned and shaped as you like them.

Simply draw which surfaces you want lit. And the tool places the light for you.

Magical? Impossible? Original? No, not really. After my first teaser, I learned from others that a couple of my ideas existed in 3ds Max as well as Blender. I’ll give credit where credit is due.

But some of my ideas were not implemented elsewhere. So, I set out to work to give the dream a try.

Mesh and Primitive Lights

Mesh lights are simple. Take the artist’s drawing, convert it to a mesh, and place it above the surface. It comes in both neon tube-like meshes or simple convex 3D hulls. Perfect for customized, precise lighting.

But mesh lights only work in the Cycles render engine. What about lamps?

Some, like point lamps, were easy to code. But area lamps took more time to implement. Their rotation and size matter. As rectangles, they need to be properly rotated to align with the direction of the artist’s drawings.

Thankfully, I found a Blender function that finds that rotation for me. Using that, area lamps are not only properly sized, but also rotated to light the surface.

Sun lamps and sky textures

I wanted to test the add-on’s potential for environmental lighting. But I couldn’t go about it the same way as the other lamps.

My original code calculates the average direction of all drawn surfaces. So often, the code’s “optimal” sun angle was noonday. No dynamic lighting.

So, I added a few parameters to clamp the sun angle and check that the sun angle actually hits where the artist specifies.

With that, Light Painter can effectively light environments.

Painting…shadows?

During my search for ideas, a friend shared with me a video by Ian Hubert (won’t share the link here - it’s behind his paywall). It’s a tutorial on using large 3D planes (called “flags” in photography) to cast shadows over your scene, guiding a viewer’s eye through your art.

Light Painter could paint lights. But could it also paint shadows?

I thought about implementation. Artists would need to select the lamps they want shadows from first. After that, they draw on surfaces, and add the flags.

It took some tinkering, as every lamp type in Blender would need to be shadowed differently. Finally, it worked.

Lighting an environment never felt more surreal.

Free for the World

Download Light Painter at github.com/semagnum/light-painter and give it a try! I’ll continue to update it over time as I see new features and fixes.

I plan to finish my animated short in the next week or so. In the meantime, check out the teaser!