Lens flare shader with real time preview

Description

Apply this material shader to a plane parented in front of a camera to get highly customisable, real time lens flare effect. Choose from either synthesised lens-flare elements - or your own images.
[Example](http://www.youtube.com/watch?v=s0k6vbWmhO0)

You Tube Tutorials Here:

[Part 1 LensFlare Tutorial Part 1 of 4: Blender Real TIme Lens Flare Shader Introduction.](http://youtu.be/Whbq8H6Ltvk)

[Part 2: LensFlare Tutorial: Part 2 of 4: How To Set Up a LensFlare Shader in Blender Cycles.](http://youtu.be/mf69t-hKxVk)

[Part 3 :](http://youtu.be/2leKfFhsa6o)[LensFlare Tutorial Part 3 of 4: Blender Lens Flare: Automatic Masking](http://youtu.be/2leKfFhsa6o)

Blog Notes Here:

[http://blendbits.blogspot.com.au/2013/05/lens-flare-shader-for-blender-cycles.html](http://blendbits.blogspot.com.au/2013/05/lens-flare-shader-for-blender-cycles.html)

* Real time 3D viewport preview.
* Lens-flare light source position co-ordinates may be set by the user.
* Highly customisable Bloom, Starburst, Rainbow, Disk, RIng,Blot and Hole elements.
* Number of spots, and the distribution of spot type, may be varied by the user.
* Optional user definable images for all lens-flare elements (new feature)
* ... and more!

Comments (19)

P
plasmasolutions almost 13 years ago

Thanks a lot for your work (even if it's "only" porting) If you had not done it, we would not have a shader now :) One thing I had to change was to set the OSL script from external to internal and assign the script textblock. Otherwise it does not show anything at all... Maybe you could change that and reupload?! Greeting, Thomas

I
iReboot almost 13 years ago

Thanks Thomas. I've re-uploaded the files (several times!). THe external shader (lensflare.osl) file looks like it was being stripped from the .zip -- so I've switched to internal script mode. Looks like I still have a problem with absolute texture file paths for the Earth texture (at the moment this has to be re-linked to textures/earth/...) -- so will fix this tonight with 'packing' and re-up load. Thanks again.. Dylan

I
iReboot almost 13 years ago

It looks like the files download and correctly run now ("lensflare_shader_blend_example_1c.zip" version and onwards) - can any one confirm this? Cheers Dylan

A
atrenus almost 13 years ago

Thank you so much!!!!

N
nigelgardiner almost 13 years ago

Hi, sorry excuse my ignorance but I'm trying to download the script on a mac and I can't seem to find the osl file only a blend file? There is nothing actually in the Mac osx folder. Again apologies if the answer is staring me in the face. I've watched the tutorials and this looks like a great addition.

N
nigelgardiner almost 13 years ago

ok, I can run the blend file and the shader is there but how do I save out the osl file?

I
iReboot almost 13 years ago

Hi Nigel, This is a good question! Yes - the .blend file includes the osl shader -- so you don't have to save it out (like in the video tutorial) - it should just run. Apologies for any confusion - I made the video before uploading the file to Blendswap (where all extra non-texture files get stripped out). So... the .blend file should just work (don't forget to enable OSL shaders though!) e.g. - In the Render (camera icon) settings: -- Device: is set to CPU (not GPU) -- Open Shading Language is checked. Good luck - let me know if you have any problems. Dylan

N
nigelgardiner almost 13 years ago

Hi Dylan Thanks yep, I've got it up and running no problem. But how do I use the shader in other blend files? I'm guessing I need to save it out somehow but not sure how? Guessing I could just append files to your blend file but that seems somewhat inelegant? Oh and is it possible to turn the initial light source completely off so only the flare artifacts remain? thanks Nigel.

I
iReboot almost 13 years ago

Hi Nigel, Sorry for the slow reply. I've just uploaded a tutorial that helps answer this. (Tutorial 3 above). It's quite a long tutorial though -- here's a direct link to the bit you want. http://www.youtube.com/watch?feature=player_detailpage&v=2leKfFhsa6o#t=442s Regarding turning off the 'light source'. Yes this can be done. The shader generates all its 'lights' internally. Each lens flare element (bloom, starburst, rainbow and all the spots) can have their intensity levels set from 0 (invisible) to 1 or higher (very bright). Just tweak the numbers on the shader :-) Cheers Dylan

N
nigelgardiner almost 13 years ago

Hi Dylan Thanks for that, much appreciated. cheers Nigel.

I
iReboot almost 13 years ago

@BrotherMechanic. Thanks for the lens flare image links. Anyone can use these by just down loading the images to their texture folder -- and then typing in the local path to the images directly into the shader node (just replace the ones that are there). In this way -- you can use any lens flare element you like! Cheers Dylan

S
SwapaGG almost 13 years ago

Good ! You made important a deal !!! Continue it is.With Renderman-like shaders all clear.And what GLSL and WebGL ?(Please,without links at Thomas Dinges :D)

A
Adveric over 12 years ago

Thank You

S
Sakrecoer over 12 years ago

THANK YOU!!!!

L
luciferlover87 about 12 years ago

file keeps crashing, upload a proper version

Z
zingzong over 11 years ago

came for the lens flare

S
scottbroad over 10 years ago

Has anybody got this shader working with latest Blender releases (2.76b - Windows10)? It seems to run ok - but I don't see the flare ....

S
scottbroad over 10 years ago

---

G
Gennadym about 10 years ago

Hi! thnk you very very much! it's a great job!

Sign in to leave a comment.