How to generate shadows

I’m just getting into the basics of 3D with openFrameworks…

I’m drawing some simple planes / meshes and have an ofLight that can be moved around them. What’s the best way to generate a shadow from each object/light that will fall on other objects in the scene?

Edit: I messed up a bit when I first posted this (bug in my code was confusing me), edited above.

Hi, shadows are not within the basics of 3D graphics, you could take a look at Shadow Mapping, there is also an addon ofxShadow that can give some light (pun not intended) to this topic.

I haven’t tested this addon, and there are other methods to generate shadows. As I said it is quite complex. Good luck!

cool thanks for the tips, i had a play around with ofxShadow and also found which was the most interesting. Ultimately though I haven’t been able to get anything that looks right with the kind of complex shapes I have. Might have to come back to this in future when I’m no longer posting in the ‘beginners’ forum.

i don’t know of ofxShadow… but of-ESMShadowMapping and of-DeferredRendering works very well i tested both of them in linux64 time ago in OF 0072.

i also did an example time ago but i don’t know if it works in OF 008 shadowMap , but much better the of-DeferredRendering example above to use…