POV-Ray : Newsgroups : povray.binaries.images : Lensflare Server Time
8 Aug 2024 22:08:22 EDT (-0400)
  Lensflare (Message 9 to 18 of 18)  
<<< Previous 8 Messages Goto Initial 10 Messages
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

From: Slime
Subject: Re: Lensflare
Date: 19 May 2005 13:42:06
Message: <428ccfee$1@news.povray.org>
> only problem now: Additive_Blend(Color, 1, 0) on a given background-color,
is
> brighter than the background-color + Color.


Hmm, are you mixing it with colors like rgb 0? After some experimentation,
it looks like the usual interpolation of colors between additive and
non-additive colors doesn't work well (because of the trick the macro uses).
Try using only additive colors in your color map: if you need black, use
Additive_Blend(0,1,0)

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

You should be able to use a layered texture or pigment map as usual.

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


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Lensflare
Date: 19 May 2005 14:04:07
Message: <428cd517@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote in message news:428ccf2d$1@news.povray.org...
> > aha! that worked! thanks a lot! :)
> >
> > uhm, I can use that for my lensflare-system, can't I? :)
>
> Yes =)

thank you :)

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 14:05:12
Message: <428cd558$1@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote in message news:428ccfee$1@news.povray.org...
> > only problem now: Additive_Blend(Color, 1, 0) on a given background-color,
> is
> > brighter than the background-color + Color.
>
> Hmm, are you mixing it with colors like rgb 0? After some experimentation,
> it looks like the usual interpolation of colors between additive and
> non-additive colors doesn't work well (because of the trick the macro uses).
> Try using only additive colors in your color map: if you need black, use
> Additive_Blend(0,1,0)

as far as I know, everything except the background uses
Additive_Blend(something,1,0)

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: Nathan Kopp
Subject: Re: Lensflare
Date: 20 May 2005 00:18:24
Message: <428d6510$1@news.povray.org>
Another way to do additive transparancy is used in NKFlare (really old but
fun lens flare system written by yours truly
http://www.nathan.kopp.com/nkflare.htm).  The technique works like this:

1) use the color you want, but set transmit to 0.5
2) use "ambient 2" (instead of "ambient 1")
3) use "refraction 2.0" (instead of "refraction on")

It's this last bit... the "refraction 2.0", combined with the 0.5 transmit,
yeilds a 100% transmission.  Then, then "ambient 2", coupled with the 50%
that's left over from the transmit component, gives you the 100% of whatever
color you specify, which is added to the 100% transmission.

-Nathan


"Slime" <fak### [at] emailaddress> wrote...
> > 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: Rune
Subject: Re: Lensflare
Date: 20 May 2005 02:51:45
Message: <428d8901$1@news.povray.org>
Nathan Kopp wrote:
> Another way to do additive transparancy is used in NKFlare (really
> old but fun lens flare system written by yours truly
> http://www.nathan.kopp.com/nkflare.htm).  The technique works like
> this:
>
> 1) use the color you want, but set transmit to 0.5
> 2) use "ambient 2" (instead of "ambient 1")
> 3) use "refraction 2.0" (instead of "refraction on")

Very curious using a currently undocumented feature! The refraction keyword 
is obsolete though (except for photons, but that's unrelated), so who knows 
if it will be supported in future versions of POV-Ray?

I wonder how it was described back when it was documented? Was it mentioned 
that you could use a float rather than an on-off value? I always thought 
refraction was related to the bending of rays only (in conjunction with 
ior), not how much light passed through...

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: 20 May 2005 04:44:29
Message: <428da36d$1@news.povray.org>
"Nathan Kopp" <pov### [at] nkoppmailshellcom> wrote in message
news:428d6510$1@news.povray.org...
> Another way to do additive transparancy is used in NKFlare (really old but
> fun lens flare system written by yours truly
> http://www.nathan.kopp.com/nkflare.htm).  The technique works like this:
>
> 1) use the color you want, but set transmit to 0.5
> 2) use "ambient 2" (instead of "ambient 1")
> 3) use "refraction 2.0" (instead of "refraction on")
>
> It's this last bit... the "refraction 2.0", combined with the 0.5 transmit,
> yeilds a 100% transmission.  Then, then "ambient 2", coupled with the 50%
> that's left over from the transmit component, gives you the 100% of whatever
> color you specify, which is added to the 100% transmission.
>
> -Nathan

Ah, yes, that seems to work also :)

Maybe I should do some testing as to find out which technique is the fastest.

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: 20 May 2005 08:19:42
Message: <428dd5de@news.povray.org>
Zeger Knaepen wrote:
> Ah, yes, that seems to work also :)
>
> Maybe I should do some testing as to find out which
> technique is the fastest.

With 5100 pigments averaged together giving a render time of about 6 
minutes, I can't measure any difference. And indeed, why would there be one? 
All the same calculations are there (refraction is 1.0 per default) they 
just use different values.

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: 20 May 2005 09:55:23
Message: <428dec4b$1@news.povray.org>
"Rune" <run### [at] runevisioncom> wrote in message
news:428dd5de@news.povray.org...
> Zeger Knaepen wrote:
> > Ah, yes, that seems to work also :)
> >
> > Maybe I should do some testing as to find out which
> > technique is the fastest.
>
> With 5100 pigments averaged together giving a render time of about 6
> minutes, I can't measure any difference. And indeed, why would there be one?
> All the same calculations are there (refraction is 1.0 per default) they
> just use different values.

true

In that case, I think I'll go for Slime's solution, because it doesn't use any
undocumented features that might dissapear.

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

<<< Previous 8 Messages Goto Initial 10 Messages

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