simple Lens Flare effect

[UPDATE]
I’ve cooperated with Treeform and now got “occlusion detection” working.
The updated sample comes with a ship model, to test the occlusion detection. Screenshots would be more or less useless, because the new effect will only show something new in a life demo…
so enjoy…

AND uploaded a VIDEO of the effect on youtube:

http://www.youtube.com/watch?v=Mo6Xa1fiXIA

If anyone cares… I captured the video using Pandas built in move function:

base.movie(‘filename’, duration=10, fps=30, format=“bmp”)
This however, only records a series of images, so I used another python package to make a mpg video out of the images.
The package is pyMedia http://pymedia.org/
They’ve got a sample in their tut. section on how to convert images to videos.

[/UPDATE]

Thanks to Treeform, I could write that little lens-flare class in just a few hours…
He provided me with some sample code, that showed me how to get the lens-flare vector, so thanks Treeform…

download the code with the required graphics:

http://legion.panda3dprojects.com/download/lensflare.tar.gz

and some screenshots:



right now, the lens-flares will always be shown, when the light source is in the viewport of the camera… so I’ll need to add some code, that’ll handle the event, if some other object is blocking the light source, and therefore effectively reducing the lens-flare effect…

enjoy…

This is pretty cool!
Thanks for sharing!