Lens flare shader with real time preview

  • May 20, 2013
  • 2,119 Downloads
  • 8 Likes
  • Blender 2.6x
  • Render: Cycles
  • Creator: iReboot
  • License: CC-0
You must be logged in to download.

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

You Tube Tutorials Here:

Part 1 LensFlare Tutorial Part 1 of 4: Blender Real TIme Lens Flare Shader Introduction.

Part 2: LensFlare Tutorial: Part 2 of 4: How To Set Up a LensFlare Shader in Blender Cycles.

Part 3 :LensFlare Tutorial Part 3 of 4: Blender Lens Flare: Automatic Masking

Blog Notes Here:

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:

  • plasmasolutions profile picture
    plasmasolutions

    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

    Written May 21, 2013
  • iReboot profile picture
    iReboot

    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

    Written May 21, 2013
  • iReboot profile picture
    iReboot

    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

    Written May 22, 2013
  • atrenus profile picture
    atrenus

    Thank you so much!!!!

    Written May 27, 2013
  • brothermechanic profile picture
    brothermechanic

    Very impressive! Good work. Can you to update with more realistic textures like this (i forget link to scene from blendswap)

    http://ubuntuone.com/2HExNuIM0xRjaEYAX0onMj

    http://ubuntuone.com/2b8HhvAJ9lS24YLLTpsSTs

    http://ubuntuone.com/2xeOsmIXLzYYiKbJvHQMuz

    http://ubuntuone.com/3JCZV2p5wqjzr1QJoMXprF

    http://ubuntuone.com/5WwJkbvELSjLY9VljWqBqj

    it will be good opensource alternative to https://www.videocopilot.net/products/opticalflares/

    Thank you for script

    With respect, Ilia. brothermechanic@gnail.com

    Written May 28, 2013
  • nigelgardiner profile picture
    nigelgardiner

    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.

    Written June 06, 2013
  • nigelgardiner profile picture
    nigelgardiner

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

    Written June 06, 2013
  • iReboot profile picture
    iReboot

    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

    Written June 07, 2013
  • nigelgardiner profile picture
    nigelgardiner

    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.

    Written June 07, 2013
  • iReboot profile picture
    iReboot

    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

    Written June 13, 2013
  • nigelgardiner profile picture
    nigelgardiner

    Hi Dylan

    Thanks for that, much appreciated.

    cheers Nigel.

    Written June 16, 2013
  • iReboot profile picture
    iReboot

    @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

    Written June 07, 2013
  • SwapaGG profile picture
    SwapaGG

    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)

    Written June 18, 2013
  • Adveric profile picture
    Adveric

    Thank You

    Written October 24, 2013
  • Sakrecoer profile picture
    Sakrecoer

    THANK YOU!!!!

    Written December 09, 2013
  • luciferlover87 profile picture
    luciferlover87

    file keeps crashing, upload a proper version

    Written March 22, 2014
  • zingzong profile picture
    zingzong

    came for the lens flare

    Written August 25, 2014
  • scottbroad profile picture
    scottbroad

    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 ....

    Edited January 15, 2016
  • scottbroad profile picture
    scottbroad

    Written January 15, 2016
  • Gennadym profile picture
    Gennadym

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

    Written February 19, 2016