POV-Ray : Newsgroups : povray.newusers : media density Server Time
27 Nov 2024 15:32:27 EST (-0500)
  media density (Message 1 to 8 of 8)  
From: Tom Melly
Subject: media density
Date: 17 Sep 2002 09:07:01
Message: <3d8728f5$1@news.povray.org>
Is density clipped?

I'm having trouble getting really thick media using a density function which
might be explained if density is getting clipped to 1.

--
#macro A(V,B,C,R)#while(B-256)#if(V-128/B>=0)sphere{0,.5translate<C-4R-1,9>
pigment{rgb<1-C/8R/2C/8>}}#local V=V-128/B;#end#local B=B*2;#local C=C+1;#
end#end A(234,1,0,2)A(85,1,0,1)A(81,1,0,0)light_source{-5 1}//Tom Melly


Post a reply to this message

From: Warp
Subject: Re: media density
Date: 17 Sep 2002 09:20:51
Message: <3d872c33@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
> Is density clipped?

  I wouldn't be very surprised if it is.
  I think POV-Ray clips values to the 0-1 range in some places where it
really shouldn't (as we can see from the transmit/filter fix, where this
clipping was removed).

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Tom Melly
Subject: Re: media density
Date: 17 Sep 2002 09:32:15
Message: <3d872edf$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:3d872c33@news.povray.org...
> Tom Melly <tom### [at] tomandlucouk> wrote:
> > Is density clipped?
>
>   I wouldn't be very surprised if it is.
>   I think POV-Ray clips values to the 0-1 range in some places where it
> really shouldn't (as we can see from the transmit/filter fix, where this
> clipping was removed).

I could be wrong, but I think that I can confirm that it is clipped. At least,
when I rewrite my function to assume it is clipped at 1, everything starts
behaving as I expect....

I don't really have any strong feelings either way about clipping on density,
but, if it is clipped, it would be nice if it was clearly documented.

(well, it would stop me trying to write functions like:
density_function = function(x,y,z){min(1,x*x+z*z)})


Post a reply to this message

From: Tim Nikias
Subject: Re: media density
Date: 17 Sep 2002 09:47:08
Message: <3d87325c$1@news.povray.org>
It isn't clipped. In my experience, using higher
values amplified the effect, which is what I'd
expect it to do. But I'm not too sure about the
way you use your media, perhaps scattering
has some side-effects due to extinction?


--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

> Is density clipped?
>
> I'm having trouble getting really thick media using a density function
which
> might be explained if density is getting clipped to 1.
>


Post a reply to this message

From: Tom Melly
Subject: Re: media density
Date: 17 Sep 2002 09:52:59
Message: <3d8733bb@news.povray.org>
"Tim Nikias" <tim### [at] gmxde> wrote in message
news:3d87325c$1@news.povray.org...
> It isn't clipped. In my experience, using higher
> values amplified the effect, which is what I'd
> expect it to do. But I'm not too sure about the
> way you use your media, perhaps scattering
> has some side-effects due to extinction?
>

Quite possibly - I'll try and put a test scene together...

Whatever's happening, assuming it's clipped seems to resolve the problem.


Post a reply to this message

From: Christopher James Huff
Subject: Re: media density
Date: 17 Sep 2002 10:03:19
Message: <chrishuff-CC56FE.10013317092002@netplex.aussie.org>
In article <3d8728f5$1@news.povray.org>,
 "Tom Melly" <tom### [at] tomandlucouk> wrote:

> Is density clipped?
> 
> I'm having trouble getting really thick media using a density function which
> might be explained if density is getting clipped to 1.

Density values aren't clipped, but function patterns are. If your 
function goes out of the [0, 1] range it will be clipped, if your color 
values go out of that range nothing unexpected will happen. Scale your 
function values down with a multiplier and increase the color values to 
compensate.

It would be nice if patterns were unclipped by default or if there was a 
way to specify "no_waveform" or similar to turn clipping off.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Tom Melly
Subject: Re: media density
Date: 17 Sep 2002 10:14:01
Message: <3d8738a9$1@news.povray.org>
"Christopher James Huff" <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
>
> Density values aren't clipped, but function patterns are. If your
> function goes out of the [0, 1] range it will be clipped, if your color
> values go out of that range nothing unexpected will happen. Scale your
> function values down with a multiplier and increase the color values to
> compensate.
>

Aha! Thanks for the info.

My solution is/was pretty similiar to your suggestion:

#declare dens_func = function(x,y,z){max( med_fact, pow(x/cont_rad,2) +
pow(z/cont_rad,2) )}

(where cont_rad is the radius of the spherical media container and med_fact is
the lowest value I want used - then all I had to do was increase the intensity
of the media colour and lower med_fact until I got the effect I wanted)


Post a reply to this message

From: R  Suzuki
Subject: Re: media density
Date: 17 Sep 2002 11:11:57
Message: <3d87463d@news.povray.org>
"Christopher James Huff" <chr### [at] maccom> wrote 
> It would be nice if patterns were unclipped by default or if there was a 
> way to specify "no_waveform" or similar to turn clipping off.

I agree.
I added 'unclipping' option in the density_file patch.
http://staff.aist.go.jp/r-suzuki/e/povray/iso/df_body.htm

In case of the current patch, one can use unclipped function
patterns as following.

#declare D3D= pattern{
    density_file function 100, 100, 100 {func(x,y,z)} 
    interpolate 11 // or 10 or 12 
}

But "no_waveform" keyword would be better way.
I am now planning to add it in the future patch.

R. Suzuki


Post a reply to this message

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