POV-Ray : Newsgroups : povray.text.scene-files : real lens flare Server Time
26 Dec 2024 00:14:47 EST (-0500)
  real lens flare (Message 1 to 2 of 2)  
From: Nathan Kopp
Subject: real lens flare
Date: 1 Jun 1999 23:13:09
Message: <375492B4.C5811984@Kopp.com>
(this is the same message as in p.b.i, but I have the source here instead
of the image.)

In the general group, Zeger asked if you could make a real lens flare with
photons.  Well, as it turns out, making a real lens flare doesn't require
photons.  You see, lens flare is simply interreflection within the complex
lens system of a camera.  Some lens flare also comes from imperfections
in the camera's lenses.  The pretty colors come from dispersion.

So, all you need is some glass to reflect and refract, a bit of dispersion,
and a really bright object to get reflected and refracted.

I threw this scene together quickly in Moray.  It has a *really*
bright sphere in front of a dark checkered plane.  Between the camera
and the rest of the scene is a set of lenses.  These lenses are *not*
mathematically correct or anything like that, so they do distort the
checker pattern a bit.  The lenses look like:
              _
         /\  \ /
 scene   ||  | |   camera
         \/  /_\

I added strong dispersion (only 6 elements, though) and set max_trace_level
to 8.  This scene *requires* the Daren's dispersion patch, which is included
in UVPov. (It may also be in the superpatch, but don't quote me on that.)

This simple scene took a whopping 2 hours 43 minutes on my P266 at
512x384 with no AA.  To get a really good flare you'd need a much
more complex lens system and a much higher max_trace, so I doubt
anyone will be using this technique in there real scenes.

-Nathan

============================= realflare.pov =============================

//
//        REAL LENS FLARE - BY NATHAN KOPP
//        May 31, 1999
//
//        Requires Daren's Dispersion Patch (included in UVPov)
//
//  Persistance of Vision Raytracer V3.1
//  World definition file.
//
//  Contains 1 lights, 3 materials and 11 primitives.
//
//  This file was generated for POV-Ray V3.1 by
//  Moray V3.1 For Windows (c) 1991-1998 Lutz + Kretzschmar
//

//  Date : 05/31/1999    (31.05.1999)
//

/*
  The text between these two comments is in MorayPOV.INC and is
  automatically included in all POV files that Moray exports.
*/

default {
  texture {
    pigment { rgb <1,0,0> }
  }
}




/* // Scene Comment

This scene was created with Moray For Windows.

*/ // End Scene Comment

global_settings {
  adc_bailout 0.003922
  ambient_light <1.0,1.0,1.0>
  assumed_gamma 1.9
  hf_gray_16 off
  irid_wavelength <0.247059,0.176471,0.137255>
  max_intersections 64
  max_trace_level 8
  number_of_waves 10
  radiosity {
    brightness       3.3
    count            100
    distance_maximum 0.0
    error_bound      0.4
    gray_threshold   0.5
    low_error_factor 0.8
    minimum_reuse    0.015
    nearest_count    6
    recursion_limit  1
  }
}

background { color <0.000,0.000,0.000> }

camera {  //  Camera StdCam
  location  <      0.000,      -3.158,       0.000>
  direction <        0.0,         0.0,      1.8317> // Aperture is 0.53 degrees
  sky       <    0.00000,     0.00000,     1.00000> // Use right handed-system 
  up        <        0.0,         0.0,         1.0> // Where Z is up
  right     <    1.33333,         0.0,         0.0> // Aspect ratio
  look_at   <      0.000,       0.000,       0.000>
}

//
// *******  L I G H T S *******
//

light_source {   // Light1
  <1.606, 6.285, 0.921>
  color rgb <1.000, 1.000, 1.000>*7
}


//
// ********  MATERIALS  *******
//


#declare Glass_1 = 
   material  // Glass_1
   {   
      texture
      {      
         pigment
         {
            color rgbf <1.0, 1.0, 1.0, 1.0>
         }      
         normal
         {
            bumps , 0.001
            scale  <0.001, 0.001, 10.0>
         }      
         finish
         {
            ambient 0.1
            diffuse 0.0
            phong 0.3
            phong_size 90.0
            reflection 0.2
         }
      }   
      interior
      {
         ior 1.5
         dispersion 0.6
         disp_nelems 6
      }
   }


//  $MRY$: 'DarkTex'


#declare DarkTex = 
   material  // DarkTex
   {   
      texture
      {      
         pigment
         {
            checker
               color rgb <0.007843, 0.0, 0.007843>*3
               color rgb <0.0, 0.007843, 0.003922>*4
         }
      }
   }


//  $MRY$: 'BrightTex'


#declare BrightTex = 
   material  // BrightTex
   {   
      texture
      {      
         pigment
         {
            color rgb <1.0, 1.0, 1.0>
         }      
         finish
         {
            ambient 1.0
            diffuse 1.0
         }
      }
   }


//
// ********  REFERENCED OBJECTS  *******
//



//
// ********  OBJECTS  *******
//

#declare Lens1 = intersection {
  sphere { // Sphere004
    <0,0,0>,1
    scale <2.0, 0.5, 2.0>
    translate  -0.25*y
  }
  sphere { // Sphere005
    <0,0,0>,1
    scale <2.0, 0.5, 2.0>
    translate  0.25*y
  }
  translate  -0.3*y
}
#declare Lens2 = intersection {
  sphere { // Sphere006
    <0,0,0>,1
    scale <2.0, 0.5, 2.0>
    translate  -0.25*y
  }
  sphere { // Sphere007
    <0,0,0>,1
    scale <2.0, 0.5, 2.0>
    translate  0.25*y
  }
  translate  0.3*y
}

difference { // Lens4
  cylinder { // Cylndr001
    <0,0,1>, <0,0,0>, 1 
    scale <1.5, 1.5, 0.5>
    rotate -90.0*x
    translate  -0.25*y
  }
  object { Lens1 }
  object { Lens2 }
  material {
    Glass_1
  }
  scale <1.25, 1.0, 1.25>
  translate  -0.55*y
}


sphere { // Sphere003
  <0,0,0>,1
  material {
    BrightTex
  }
  no_shadow
  scale 0.25
  translate  <1.645867, 6.672443, 0.978075>
}


plane { // Plane001
  z,0
  material {
    DarkTex
  }
  rotate 90.0*x
  translate  <0.078785, 8.05669, -0.040753>
}


intersection { // Lens
  sphere { // Sphere001
    <0,0,0>,1
    scale <2.0, 0.5, 2.0>
    translate  -0.25*y
  }
  sphere { // Sphere002
    <0,0,0>,1
    scale <2.0, 0.5, 2.0>
    translate  0.25*y
  }
  material {
    Glass_1
  }
  scale <1.1, 1.0, 1.1>
}


Post a reply to this message

From: Ron Parker
Subject: Re: real lens flare
Date: 2 Jun 1999 10:10:56
Message: <37552d60.0@news.povray.org>
On Tue, 01 Jun 1999 22:11:00 -0400, Nathan Kopp wrote:
>This scene *requires* the Daren's dispersion patch, which is included
>in UVPov. (It may also be in the superpatch, but don't quote me on that.)

It's not, I have no excuse, and you can quote me.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.