POV-Ray : Newsgroups : povray.binaries.images : Lensflare Server Time
16 Nov 2024 10:29:39 EST (-0500)
  Lensflare (Message 1 to 10 of 18)  
Goto Latest 10 Messages Next 8 Messages >>>
From: Zeger Knaepen
Subject: Lensflare
Date: 18 May 2005 19:48:19
Message: <428bd443@news.povray.org>
Chris Colefax's Lens Effect include file has a few disadvantages: sometimes it
substracts color from the background instead of adding to it, and you need a
high max_trace_level for it to work properly.

I tried to make my own lensflare-system to compensate for this problems. First I
tried with functions, but that seemed to be way too slow. This is a test with
averaging pigments. The lensflare itself consists only of 1 plane directly in
front of the camera (using screen.inc :)), with only 1 texture. There is only
one, quite big, problem with this technique: multi-colored lensflares are
impossible, because the colors average to gray :-/

It's a TIP, but again a useless TIP in most cases.  Is there a fast way to
combine pigments in an additive way?  (already found an addictive way though)

cu!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)                 // ZK http://www.povplace.com


Post a reply to this message


Attachments:
Download 'lensflare.jpg' (50 KB)

Preview of image 'lensflare.jpg'
lensflare.jpg


 

From: Slime
Subject: Re: Lensflare
Date: 18 May 2005 21:04:41
Message: <428be629$1@news.povray.org>
> Is there a fast way to
> combine pigments in an additive way?

See my post "Additive transparency" in povray.binaries.scene-files,
2/3/2005.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Marneus Calgar
Subject: Re: Lensflare
Date: 19 May 2005 03:04:23
Message: <428c3a77$1@news.povray.org>
Very nice !

-- 
Dark Skull Software
http://www.darkskull.net

A+


Post a reply to this message

From: Rune
Subject: Re: Lensflare
Date: 19 May 2005 03:20:06
Message: <428c3e26$1@news.povray.org>
Zeger Knaepen wrote:
> Is there a fast way to combine pigments in an additive way?

As fast as average. Use average, while multiplying all colors (or 
alternatively the ambient and diffuse values) with the number of pigments 
being averaged.

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Lensflare
Date: 19 May 2005 04:12:02
Message: <428c4a52$1@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote in message news:428be629$1@news.povray.org...
> > Is there a fast way to
> > combine pigments in an additive way?
>
> See my post "Additive transparency" in povray.binaries.scene-files,
> 2/3/2005.

aha! that worked! thanks a lot! :)

uhm, I can use that for my lensflare-system, can't I? :)

cu!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)                 // ZK http://www.povplace.com


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Lensflare
Date: 19 May 2005 04:12:22
Message: <428c4a66$1@news.povray.org>
"Marneus Calgar" <nos### [at] pleasecom> wrote in message
news:428c3a77$1@news.povray.org...
> Very nice !

thank you!

I hope I finish this one, some day :)

cu!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)                 // ZK http://www.povplace.com


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Lensflare
Date: 19 May 2005 04:13:42
Message: <428c4ab6$1@news.povray.org>
"Rune" <run### [at] runevisioncom> wrote in message
news:428c3e26$1@news.povray.org...
> Zeger Knaepen wrote:
> > Is there a fast way to combine pigments in an additive way?
>
> As fast as average. Use average, while multiplying all colors (or
> alternatively the ambient and diffuse values) with the number of pigments
> being averaged.

That's how I did it, but it results in different shades of gray when I used more
than one hue.  But Slime's macro worked, so maybe this will become a fully
functional lensflare-system, someday :)

cu!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)                 // ZK http://www.povplace.com


Post a reply to this message

From: Rune
Subject: Re: Lensflare
Date: 19 May 2005 12:15:14
Message: <428cbb92@news.povray.org>
Zeger Knaepen wrote:
> "Rune" <run### [at] runevisioncom> wrote in message
> news:428c3e26$1@news.povray.org...
>> Zeger Knaepen wrote:
>>> Is there a fast way to combine pigments in an additive way?
>>
>> As fast as average. Use average, while multiplying all colors (or
>> alternatively the ambient and diffuse values) with the number of
>> pigments being averaged.
>
> That's how I did it, but it results in different shades of gray when
> I used more than one hue. But Slime's macro worked, so maybe this
> will become a fully functional lensflare-system, someday :)

Slime's macro can be used for creating pigments that are added to what is 
*behind* the object surface. But if you want to also add several of these 
pigments to *each other*, while still using one object surface only, then 
you can still use an average where you multiply all colors (or ambient and 
diffuse values) with the number of pigments being averaged.

So if you use both Slime's macro for the colors *and* the average trick, 
then you can have several pigments that are additive *both* to the 
background *and* to each other. :)

Example:

plane {-z, 0
   pigment {checker rgb 0.3, rgb 0.7}
   finish {ambient 1 diffuse 0}
   translate 10*z
}
plane {-z, 0
   pigment {
      average
      pigment_map {
         [1, spherical color_map {[0 transmit 0.99][0.3,rgbt <1,0,0,0.99>]} 
translate < 0.6, 0.0,0>]
         [1, spherical color_map {[0 transmit 0.99][0.3,rgbt <0,1,0,0.99>]} 
translate <-0.3, 0.5,0>]
         [1, spherical color_map {[0 transmit 0.99][0.3,rgbt <0,0,1,0.99>]} 
translate <-0.3,-0.5,0>]
      }
   }
   finish {ambient 100*3 diffuse 0}
   translate 3*z
}

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Lensflare
Date: 19 May 2005 13:05:12
Message: <428cc748@news.povray.org>
"Rune" <run### [at] runevisioncom> wrote in message
news:428cbb92@news.povray.org...
> Slime's macro can be used for creating pigments that are added to what is
> *behind* the object surface. But if you want to also add several of these
> pigments to *each other*, while still using one object surface only, then
> you can still use an average where you multiply all colors (or ambient and
> diffuse values) with the number of pigments being averaged.
>
> So if you use both Slime's macro for the colors *and* the average trick,
> then you can have several pigments that are additive *both* to the
> background *and* to each other. :)

yep, that's what I'm using now :) (see attachment)

only problem now: Additive_Blend(Color, 1, 0) on a given background-color, is
brighter than the background-color + Color.


cu!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)                 // ZK http://www.povplace.com


Post a reply to this message


Attachments:
Download 'lensflare2.jpg' (53 KB)

Preview of image 'lensflare2.jpg'
lensflare2.jpg


 

From: Slime
Subject: Re: Lensflare
Date: 19 May 2005 13:38:53
Message: <428ccf2d$1@news.povray.org>
> aha! that worked! thanks a lot! :)
>
> uhm, I can use that for my lensflare-system, can't I? :)


Yes =)

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

Goto Latest 10 Messages Next 8 Messages >>>

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