POV-Ray : Newsgroups : povray.text.scene-files : Lens Flare Blocker Ver 1.0 (Superpatch or MegaPov ONLY) Server Time
28 Jul 2024 14:33:43 EDT (-0400)
  Lens Flare Blocker Ver 1.0 (Superpatch or MegaPov ONLY) (Message 1 to 4 of 4)  
From: H E  Day
Subject: Lens Flare Blocker Ver 1.0 (Superpatch or MegaPov ONLY)
Date: 22 Jan 2000 19:52:43
Message: <388A50AC.3FDC5077@fci.net>
Here's a quick include file that I use to block Lens Flares in pov.
You'll need SuperPatch or MegaPov to run it, though.  Oh, I've got this
setup for NKFlare, but you can probably set it up for Colefax's too.

Here are the new declares:

#declare Distribution = 1/5
Distribution of rays around the Lens Flare location (usually the radius
of the object giving off light)

#declare BlockObject = union {Obj}
Object that will block the Lens Flare.

#declare MaskType = 1
Type of masking.  1 is scale and brightness, 2 is brightness, 3 is
scale.  Try them and see what I mean.

#declare MinimumAmount = 0
Minimum amount of light needed before the lens flare cuts out.

#include "FLRBLKR1.inc"
Replaces #include "NKFlare.inc"

That about sums it up.  You can use any object, any flare, any
brightness, any size.  The only thing that needs to be is that the new
declares come after the old declares.  There is one limitation that I
can think of.  You can't have a flare on the surface of a object and
have it block the flare correctly. Dunno how to fix this.

Can't think of anything else.
Comments??

//Here are the files.  The first one is blocker.pov

#include "colors.inc"
#declare sky_vect = y;
#declare cam_loc = <0,0,-4>*3;
#declare lookat = <0,0,0>;
camera {
  location  cam_loc
  direction 1.5*z
  look_at   lookat
}

#declare Obj =
union {
sphere {x*2,1}
sphere {-x*2,1}
}

#declare flare_size = <1,1,1>;
#declare flare_brightness = <1/4,1/2,1>*4;
#declare light_loc = <30-60*clock,-20+10*clock,0>
#declare Distribution = 1/5
#declare BlockObject = union {Obj}
#declare MaskType = 1
#declare MinimumAmount = 0
#include "50mm.flr"
#include "FLRBLKR1.inc"
light_source {light_loc rgb 2}


union {
Obj
pigment {rgb 1}
}
global_settings { #max_trace_level 20}

//End of file

//Then FLRBLKR1.inc

#declare PT1 =  vnormalize((light_loc+(<1,0,0>*Distribution)
)-cam_loc)
#declare PT2 =  vnormalize((light_loc+(<-1,0,0>*Distribution)
)-cam_loc)
#declare PT3 =  vnormalize((light_loc+(<1,1,0>*Distribution)
)-cam_loc)
#declare PT4 =  vnormalize((light_loc+(<-1,1,0>*Distribution)
)-cam_loc)
#declare PT5 =  vnormalize((light_loc+(<1/2,-1,0>*Distribution)
)-cam_loc)
#declare PT6 =  vnormalize((light_loc+(<-1/2,-1,0>*Distribution)
)-cam_loc)
#declare PT7 =  vnormalize((light_loc+(<1/2,0,1>*Distribution)
)-cam_loc)
#declare PT8 =  vnormalize((light_loc+(<-1/2,0,1>*Distribution)
)-cam_loc)
#declare PT9 =  vnormalize((light_loc+(<1,0,-1>*Distribution)
)-cam_loc)
#declare PT10 = vnormalize((light_loc+(<-1,0,-1>*Distribution)
)-cam_loc)
#declare PT11 = vnormalize((light_loc+(<1/2,1,-1>*Distribution)
)-cam_loc)
#declare PT12 = vnormalize((light_loc+(<-1/2,1,-1>*Distribution)
)-cam_loc)
#declare PT13 = vnormalize((light_loc+(<1/2,-1,1>*Distribution)
)-cam_loc)
#declare PT14 = vnormalize((light_loc+(<-1/2,-1,1>*Distribution)
)-cam_loc)

#declare FlareObject =
sphere {light_loc,.001  pigment {rgbt 1} finish {ambient 0 diffuse 0
phong 0}}


#declare CK1 = <0,0,0>
#declare CK2 = <0,0,0>
#declare CK3 = <0,0,0>
#declare CK4 = <0,0,0>
#declare CK5 = <0,0,0>
#declare CK6 = <0,0,0>
#declare CK7 = <0,0,0>
#declare CK8 = <0,0,0>
#declare CK9 = <0,0,0>
#declare CK10 = <0,0,0>
#declare CK11 = <0,0,0>
#declare CK12 = <0,0,0>
#declare CK13 = <0,0,0>
#declare CK14 = <0,0,0>
#declare OR = <0,0,0>


#declare LK1 =
trace(BlockObject,cam_loc,PT1,CK1);
#declare LK2 =
trace(BlockObject,cam_loc,PT2,CK2);
#declare LK3 =
trace(BlockObject,cam_loc,PT3,CK3);
#declare LK4 =
trace(BlockObject,cam_loc,PT4,CK4);
#declare LK5 =
trace(BlockObject,cam_loc,PT5,CK5);
#declare LK6 =
trace(BlockObject,cam_loc,PT6,CK6);
#declare LK7 =
trace(BlockObject,cam_loc,PT7,CK7);
#declare LK8 =
trace(BlockObject,cam_loc,PT8,CK8);
#declare LK9 =
trace(BlockObject,cam_loc,PT9,CK9);
#declare LK10 =
trace(BlockObject,cam_loc,PT10,CK10);
#declare LK11 =
trace(BlockObject,cam_loc,PT11,CK11);
#declare LK12 =
trace(BlockObject,cam_loc,PT12,CK12);
#declare LK13 =
trace(BlockObject,cam_loc,PT13,CK13);
#declare LK14 =
trace(BlockObject,cam_loc,PT14,CK14);

#declare OVERRIDE =
trace(FlareObject,cam_loc,vnormalize(light_loc-cam_loc),OR);


#if (CK1.x != 0 | CK1.y != 0 | CK1.z != 0)
#declare FLT1 = 0
#else
#declare FLT1 = 1
#end
#if (CK2.x != 0 | CK2.y != 0 | CK2.z != 0)
#declare FLT2 = 0
#else
#declare FLT2 = 1
#end
#if (CK3.x != 0 | CK3.y != 0 | CK3.z != 0)
#declare FLT3 = 0
#else
#declare FLT3 = 1
#end
#if (CK4.x != 0 | CK4.y != 0 | CK4.z != 0)
#declare FLT4 = 0
#else
#declare FLT4 = 1
#end
#if (CK5.x != 0 | CK5.y != 0 | CK5.z != 0)
#declare FLT5 = 0
#else
#declare FLT5 = 1
#end
#if (CK6.x != 0 | CK6.y != 0 | CK6.z != 0)
#declare FLT6 = 0
#else
#declare FLT6 = 1
#end
#if (CK7.x != 0 | CK7.y != 0 | CK7.z != 0)
#declare FLT7 = 0
#else
#declare FLT7 = 1
#end
#if (CK8.x != 0 | CK8.y != 0 | CK8.z != 0)
#declare FLT8 = 0
#else
#declare FLT8 = 1
#end#if (CK9.x != 0 | CK9.y != 0 | CK9.z != 0)
#declare FLT9 = 0
#else
#declare FLT9 = 1
#end
#if (CK10.x != 0 | CK10.y != 0 | CK10.z != 0)
#declare FLT10 = 0
#else
#declare FLT10 = 1
#end#if (CK11.x != 0 | CK11.y != 0 | CK11.z != 0)
#declare FLT11 = 0
#else
#declare FLT11 = 1
#end
#if (CK12.x != 0 | CK12.y != 0 | CK12.z != 0)
#declare FLT12 = 0
#else
#declare FLT12 = 1
#end#if (CK13.x != 0 | CK13.y != 0 | CK13.z != 0)
#declare FLT13 = 0
#else
#declare FLT13 = 1
#end
#if (CK14.x != 0 | CK14.y != 0 | CK14.z != 0)
#declare FLT14 = 0
#else
#declare FLT14 = 1
#end

//#if (OR.x != 0 | OR.y != 0 | OR.z != 0)
//#declare TotalBrightness = 1
//#else
#declare TotalBrightness =
(FLT1+FLT2+FLT3+FLT4+FLT5+FLT6+FLT7+FLT8+FLT9+FLT10+FLT11+FLT12+FLT13+FLT14)/14

//#end

#if (TotalBrightness < MinimumAmount)
#declare TotalBrightness = 0
#end

#if (TotalBrightness = 0)
#if (Glow = on)
sphere {light_loc,Distribution*5 hollow on no_shadow pigment {rgbt 1}
interior {media{emission flare_brightness/30/Distribution}}}
#end
#end

sphere {light_loc,Distribution hollow on no_shadow pigment {rgb 10}}




#switch (MaskType)
#case (1)
#if (TotalBrightness > 0)
#declare flare_size = flare_size*TotalBrightness;
#declare flare_brightness = flare_brightness*((TotalBrightness/2)+1/2);
#include "nkflare.inc"
#end
#break
#case (2)
#if (TotalBrightness > 0)
#declare flare_size = flare_size;
#declare flare_brightness = flare_brightness*TotalBrightness;
#include "nkflare.inc"
#end
#break
#case (3)
#if (TotalBrightness > 0)
#declare flare_size = flare_size*TotalBrightness;
#declare flare_brightness = flare_brightness;
#include "nkflare.inc"
#end
#break
#end

//End of file
--
H.E. Day
------------------------
Science is merely a method of gathering data and information.
Science *cannot* prove facts.
It can only provide theories that fit given data.
Technology is merely Science applied to common situations.
Technology is used for both good and evil.
Society is a framework mostly dependent on the willing participation of
it
subjects.
Kingdoms and dominions come and go, none are eternal.
In the end, Society, Technology, and Science do not matter.  Only the
actions
and choices of the individual will matter. <><


Post a reply to this message

From: H E  Day
Subject: Re: Lens Flare Blocker Ver 1.0 (Superpatch or MegaPov ONLY)
Date: 22 Jan 2000 21:30:27
Message: <388A6799.9D74C91@fci.net>
The blocker.pov file SHOULD look like this:

#include "colors.inc"
#declare sky_vect = y;
#declare cam_loc = <0,0,-4>*3;
#declare lookat = <0,0,0>;
camera {
  location  cam_loc
  direction 1.5*z
  look_at   lookat
}

#declare Obj =
union {
sphere {x*2,1}
sphere {-x*2,1}
}

#declare flare_size = <1,1,1>;
#declare flare_brightness = <1/4,1/2,1>*4;
#declare light_loc = <(30-60*clock)/2,-5+10*clock,10>
#declare Distribution = 1/3
#declare BlockObject = union {Obj}
#declare MaskType = 1
#declare Glow = off
#declare MinimumAmount = 0
#include "50mm.flr"
#include "FLRBLKR1.inc"
light_source {light_loc rgb 2}


union {
Obj
pigment {rgb 1}
}
global_settings { #max_trace_level 20}

Sorry.


--
H.E. Day
------------------------
Science is merely a method of gathering data and information.
Science *cannot* prove facts.
It can only provide theories that fit given data.
Technology is merely Science applied to common situations.
Technology is used for both good and evil.
Society is a framework mostly dependent on the willing participation of it
subjects.
Kingdoms and dominions come and go, none are eternal.
In the end, Society, Technology, and Science do not matter.  Only the actions
and choices of the individual will matter. <><


Post a reply to this message

From: Darcy Johnston
Subject: Re: Lens Flare Blocker Ver 1.0 (Superpatch or MegaPov ONLY)
Date: 23 Jan 2000 19:35:23
Message: <388b9e4b@news.povray.org>
H.E. Day <hed### [at] fcinet> wrote in message news:388A50AC.3FDC5077@fci.net...
> Here's a quick include file that I use to block Lens Flares in pov.
> You'll need SuperPatch or MegaPov to run it, though.  Oh, I've got this
> setup for NKFlare, but you can probably set it up for Colefax's too.

How does this differ from the ability to hide a lens flare behind an object?


Post a reply to this message

From: H E  Day
Subject: Re: Lens Flare Blocker Ver 1.0 (Superpatch or MegaPov ONLY)
Date: 23 Jan 2000 23:14:29
Message: <388BD174.EFEB494C@fci.net>
This'll scale it to work with any object.  Try the test anim and you'll see what
I mean.  The normal way to hide a LF behind a object just makes the LF a actual
object in the scene.  Depending on which Mask method you use, the LF will scale,
and be the brightness dependent on the amount of Distribution and whether or not
the LF location is behind the declared object.

Here, try this.  Put one of your TIE Fighters infront of a LF and slowly move it
out of the way.

--
H.E. Day
------------------------
Science is merely a method of gathering data and information.
Science *cannot* prove facts.
It can only provide theories that fit given data.
Technology is merely Science applied to common situations.
Technology is used for both good and evil.
Society is a framework mostly dependent on the willing participation of it
subjects.
Kingdoms and dominions come and go, none are eternal.
In the end, Society, Technology, and Science do not matter.  Only the actions
and choices of the individual will matter. <><


Post a reply to this message

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