Lighting Tests

Lighting Tests
test20100609_cubeLighting_003
Twinings tea boxes make nice props. Thankfully, Nigella is nowhere to be seen

Emulating lighting will be a real focus for my end of year uni project and an upcoming installation piece (more on that very soon, once the official promo goes live). I need to create something that is capable to at least initially trick the eye into believing a real light source is casting shadows, but still remain CPU-friendly so that these shapes can respond in real-time to the movement of people.

As my own point of reference, I setup a simple, single light source stage, with small boxes. The idea being that I can get a sense of how light and shadow move around geometric shapes. It does sound fairly basic, but this is proving quite difficult to create convincingly, and as I delve deeper into what’s become a complex world of OpenGL and GLSL shaders, I’m on the lookout to keep things as simple as possible.

test20100609_cubeLighting_002
As the light source moves closer to the objects, shadows begin to spread in different directions

At least in my mind, what would be ideal is to have control of one end of this shadow, with the other ‘attached’ to the base of the object. As movement of the viewer is tracked, the controllable end of the shadow reflects this movement in some way. OpenGL deals heavily with generation of 3D objects and I’m beginning to wonder if rendering shadows in 2D would make my life easier. If so, the next question is how to marry flat shapes along with 3 dimensional shapes. As the video below shows, shadows become a lot more complex once they interact with another object…

%CODE1%

Instead of getting back into code (the written variety anyway), I created a similar setup in Quartz Composer and Max/MSP to see just how far off the mark Quartz’s inbuilt lighting module is. I’ve used this already as a test for projecting on a model building, so I’ve already seen it’s shortcomings. Notable is the way the shadow separates from the base of the object in the video below…

%CODE2%

This is by no means terrible, but the question is whether it’s going to be close enough to trick the human eye. The tests I have done with projecting onto the model building actually suggest that I can get away with a lot more off the screen, but whether this is because of the lower resolution of a projector, or the bleed of strong lighting, I’m unsure.

For the time being, I’m going to keep working with Quartz’s basic lighting module and poking around in OpenGL at the same time. Having access to a projector would also make things much easier. Anyone have a spare one laying around?



3 thoughts on “Lighting Tests”

  • Mhm, nice. How all this went? Did you stick to QC or ditched it? I’m working with some 3d models and on complex models shadows are quite shit.

  • Hi Emer. I didn’t end up pursuing the project in QC; you’re right, shadows on complex models are pretty terrible. I have had some better results in MaxMSP Jitter, but shadow casting is still non-existent in Max as far as I can tell.

    Real-time rendering of lighting seems to be something that still has a long way to go in most programming environments.

Leave a Reply to ScottCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.