POV-Ray : Newsgroups : povray.newusers : Adding multiple media/density Server Time
31 Oct 2024 21:23:39 EDT (-0400)
  Adding multiple media/density (Message 1 to 6 of 6)  
From: Gunnar
Subject: Adding multiple media/density
Date: 8 May 2007 07:45:02
Message: <web.464061a54119e980678ea4f80@news.povray.org>
Hello,
I am a quite new POV-Ray user. Maybe this is a simple question, maybe not.
I want to have some tori that intersect in a certain area. Every torus is
rotated a little. Imagine a bunch of flowers or similar things. They don't
necessarily need to be tori, cylinders work as well (for now).
Now I want to have the following effect: Where one cylinder/torus is alone,
I want to have low density. The more cylinders intersect, the higher the
density should be. In terms of flowers: Where the flowers are held
together, there should be high density.
I think I have to use the media and density statements but did not manage to
get the desired result.

Any help is highly appreciated!

Greets
Gunnar


Post a reply to this message

From: Gunnar
Subject: Re: Adding multiple media/density
Date: 8 May 2007 09:25:01
Message: <web.464078ccf88c319c678ea4f80@news.povray.org>
I tried some things and ended up trying it like this (simplified):
torus {
    2,0.5
    pigment{rgbt <0,0,0,1>}
    hollow
    interior{
      media{
        intervals 1
        absorption rgb<0,0.2,0>
    }
  }
}
giving me a light magenta torus.
Then I intersected the torus with 2 other rotated tori. Where only 2 tori
intersect the result is good: a somewhat deeper magenta. As soon as 3 or
more tori intersect this area becomes black while it should be just even
deeper magenta.
How can I change this? Any ideas? Thanks in advance.


Post a reply to this message

From: Lukas Winter
Subject: Re: Adding multiple media/density
Date: 8 May 2007 09:43:10
Message: <pan.2007.05.08.13.43.10.816698@removeit.geloescht.net>
Am Tue, 08 May 2007 09:20:13 -0400 schrieb Gunnar:
> (...) giving me a light magenta torus.
> Then I intersected the torus with 2 other rotated tori. Where only 2 tori
> intersect the result is good: a somewhat deeper magenta. As soon as 3 or
> more tori intersect this area becomes black while it should be just even
> deeper magenta.
> How can I change this? Any ideas? Thanks in advance.

Have you tried a higher max_trace_level?


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Adding multiple media/density
Date: 8 May 2007 09:50:09
Message: <46408011$1@news.povray.org>
Gunnar wrote:

> giving me a light magenta torus.
> Then I intersected the torus with 2 other rotated tori. Where only 2 tori
> intersect the result is good: a somewhat deeper magenta. As soon as 3 or
> more tori intersect this area becomes black while it should be just even
> deeper magenta.

Do you get any warnings during parsing or rendering? You need to
increase max_trace_level when intersecting multiple transparent
objects, and some media sampling related parameters might need
tweaking as well.

Depending on what you want to achieve, you can also try to
use filtering pigments (rgbf) instead of media.


Post a reply to this message

From: Alain
Subject: Re: Adding multiple media/density
Date: 8 May 2007 17:49:53
Message: <4640f081$1@news.povray.org>
Gunnar nous apporta ses lumieres en ce 8 / 05 / 2007 09:20:
> I tried some things and ended up trying it like this (simplified):
> torus {
>     2,0.5
>     pigment{rgbt <0,0,0,1>}
>     hollow
>     interior{
>       media{
>         intervals 1
>         absorption rgb<0,0.2,0>
>     }
>   }
> }
> giving me a light magenta torus.
> Then I intersected the torus with 2 other rotated tori. Where only 2 tori
> intersect the result is good: a somewhat deeper magenta. As soon as 3 or
> more tori intersect this area becomes black while it should be just even
> deeper magenta.
> How can I change this? Any ideas? Thanks in advance.
> 
> 
> 
> 
As you add transparent objects, a ray need to cross an increasingly large number 
of surfaces. In POV-Ray, that nomber is limited by default to 5. You need one 
for entering the object, one to exit it, and a last one to reach the background, 
or whatever lies behind.
With 2 objects, you cross 4 surfaces and a last step to the background. Add a 
third object and the count become 7, 2 steps over the default limit. When you 
exeed the limit, BLACK is returned.
You need to add the following to your scene:

global_settings{ max_trace_level 99 }

This will be good for 44 objects plus the background. The maximum value that can 
be used is max_trace_level 255. It may be a good idea to alter the adc_bailout 
value to limit how deep you go. It's default is 1/256, as this is the smalest 
difference you can usualy get. If you goes below that difference from a surface, 
the evaluation stops there and returns the current value, NOT black.

-- 
Alain
-------------------------------------------------
I find that the harder I work, the more luck I seem to have.
Thomas Jefferson


Post a reply to this message

From: Gunnar
Subject: Re: Adding multiple media/density
Date: 14 May 2007 02:50:02
Message: <web.464805baf88c319c678ea4f80@news.povray.org>
This works perfectly. Thanks for the hint AND the explanation. 99 is
sufficient for now... ;)


Post a reply to this message

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