POV-Ray : Newsgroups : povray.unofficial.patches : Photons and max_gradient Server Time
1 Nov 2024 03:16:54 EDT (-0400)
  Photons and max_gradient (Message 1 to 8 of 8)  
From: Tom Melly
Subject: Photons and max_gradient
Date: 13 Jul 2001 05:47:11
Message: <3b4ec39f$1@news.povray.org>
I'm needing to set a max_gradient for an iso (see underwater image posted to
bin.img).

The odd thing is that the max_gradient is only required when I turn on photons.
Is this a bug or an expected side-effect of using photons?

--
#macro G(D,E,F)#local I=array[3]{D,E,F}#local B=0;triangle{#while(
B<3)#while(I[B])A[mod(I[B],10)]+#local I[B]=div(I[B],10);#end<-5,-
2,9>#local B=B+1;#end}#end #local A=array[7]{x,x*2,x*4,y,y*2,y*4,z
}light_source{-x*6-z*9,1}mesh{G(105,10,146)G(105,246,10)G(105,56,
146)G(105,1256,246)G(1256,126,220)G(22156,2216,201)pigment{rgb 1}}//TM


Post a reply to this message

From: Christoph Hormann
Subject: Re: Photons and max_gradient
Date: 13 Jul 2001 06:15:03
Message: <3B4ECAB5.1639522C@gmx.de>
Tom Melly wrote:
> 
> I'm needing to set a max_gradient for an iso (see underwater image posted to
> bin.img).
> 
> The odd thing is that the max_gradient is only required when I turn on photons.
> Is this a bug or an expected side-effect of using photons?
> 

What do you mean you 'need to' set a max_gradient?

The default max_gradient is 1 and you should set a higher value if the
real maximum gradient is higher no matter if you are using photons or not. 

It can happen that a scene renders all right with a too low max_gradient,
but this is always fairly accidental.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Tom Melly
Subject: Re: Photons and max_gradient
Date: 13 Jul 2001 06:25:03
Message: <3b4ecc7f$1@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3B4ECAB5.1639522C@gmx.de...

> What do you mean you 'need to' set a max_gradient?

<snip>

Oh, I thought that with "eval", MP would generally get it right - however a
quick (re)read of the docs show that this is only the case when mg is around 1.
In my case it's closer to 25.

Ta... (still, it seems odd that photons should make a difference...)


Post a reply to this message

From: Christoph Hormann
Subject: Re: Photons and max_gradient
Date: 13 Jul 2001 08:26:17
Message: <3B4EE977.2FEC87C0@gmx.de>
Tom Melly wrote:
> 
> Oh, I thought that with "eval", MP would generally get it right - however a
> quick (re)read of the docs show that this is only the case when mg is around 1.
> In my case it's closer to 25.
> 
> Ta... (still, it seems odd that photons should make a difference...)

You can add an optional 3 component vector to 'eval' for adaptation to
special situations, see the Megapov docu section 5.2.7. for a detailed
description.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Tom Melly
Subject: Re: Photons and max_gradient
Date: 13 Jul 2001 09:26:39
Message: <3b4ef70f$1@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3B4EE977.2FEC87C0@gmx.de...
>
> You can add an optional 3 component vector to 'eval' for adaptation to
> special situations, see the Megapov docu section 5.2.7. for a detailed
> description.
>

Yes, I read that. Couldn't make head nor tail of it ;)

I'll stick with my tried-and-tested method.

Run with eval
Set max_gradient to eval output
Run with eval again
Check eval output hasn't gone up (sometimes does).

The whole business confuses me though - if eval "knows" what the true
max_gradient should have been, why didn't it just use it in the first place?
Okay, presumably it can only "know" the max_gradient after the event, but how?
Without using a higher max_gradient, how can it know what value to predict?

Oh, well. Sesame Street is on tomorrow morning. Hopefully it will be the letter
R, the number 12, and iso-surfaces....


Post a reply to this message

From: Christoph Hormann
Subject: Re: Photons and max_gradient
Date: 13 Jul 2001 10:27:53
Message: <3B4F05F9.E0635210@gmx.de>
Tom Melly wrote:
> 
> Yes, I read that. Couldn't make head nor tail of it ;)
> 
> I'll stick with my tried-and-tested method.
> 
> Run with eval
> Set max_gradient to eval output
> Run with eval again
> Check eval output hasn't gone up (sometimes does).
> 

try 'eval <10, 15, 0.99>'

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Ron Parker
Subject: Re: Photons and max_gradient
Date: 13 Jul 2001 11:24:46
Message: <slrn9ku4lv.hs6.ron.parker@fwi.com>
On Fri, 13 Jul 2001 14:26:39 +0100, Tom Melly wrote:
>The whole business confuses me though - if eval "knows" what the true
>max_gradient should have been, why didn't it just use it in the first place?
>Okay, presumably it can only "know" the max_gradient after the event, but how?
>Without using a higher max_gradient, how can it know what value to predict?

It keeps track of the actual values as it subdivides the space, and if it 
finds a ray where two adjacent tests give values that would require a 
gradient above the current maximum, it assumes that the "real" maximum is at 
least as large as the observed value.  Of course, at that point it's too
late to retrace all the rays it's already done, so it just tells you about
it for next time.

Setting the starting maximum higher causes it to take more samples, which
in turn increases the chance that it will find any regions of even higher
gradient that might exist. 

-- 
plane{-z,-3normal{crackle scale.2#local a=5;#while(a)warp{repeat x flip x}rotate
z*60#local a=a-1;#end translate-9*x}pigment{rgb 1}}light_source{-9red 1rotate 60
*z}light_source{-9rgb y rotate-z*60}light_source{9-z*18rgb z}text{ttf"arial.ttf"
"RP".01,0translate-<.6,.4,.02>pigment{bozo}}light_source{-z*3rgb-.2}//Ron Parker


Post a reply to this message

From: Tom Melly
Subject: Re: Photons and max_gradient
Date: 13 Jul 2001 12:12:48
Message: <3b4f1e00$1@news.povray.org>
"Ron Parker" <ron### [at] povrayorg> wrote in message
news:slr### [at] fwicom...

<snip>

Many thanks. I actually understood that. Must have been the idiot's version ;)

BTW why do those "idiot's guide to..." sell so well? Why would anyone buy a
technical book written by an idiot?


Post a reply to this message

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