POV-Ray : Newsgroups : povray.beta-test : Strange speed differences between 3.6 and 3.7 with complex media Server Time
4 Jul 2024 13:20:22 EDT (-0400)
  Strange speed differences between 3.6 and 3.7 with complex media (Message 1 to 2 of 2)  
From: Warp
Subject: Strange speed differences between 3.6 and 3.7 with complex media
Date: 29 Aug 2009 12:46:03
Message: <4a995b4b@news.povray.org>
I was developing a scene using media, when I stumbled accross this weird
speed difference between POV-Ray 3.6 and 3.7, which seems to behave strangely.
It seems to be somehow related to having multiple medias inside the object
and defining "samples" for one of them or both. Sometimes 3.6 is faster,
sometimes 3.7, for the exact same scene. I'm not sure if this is a bug in
either version, or both, or none.

  I rendered the scene below in my linux box (Pentium4 @ 3.4GHz) using
POV-Ray 3.6 and 3.7 beta 33, at 1024x768. The transformations in the first
media are there just to make the rendering slower, to get a better
comparison (as far as I can tell, the difference is there even without
those transformations).

  Here are the timings:

Neither media has "samples" defined:
  3.6: 44 seconds, 3.7: 40 seconds.

Only the first media has "samples" defined:
  3.6: 44 seconds, 3.7: 92 seconds.

Only the second media has "samples" defined:
  3.6: 99 seconds, 3.7: 40 seconds.

Both medias have "samples" defined:
  3.6: 99 seconds, 3.7: 92 seconds.

  It seems that 3.6 and 3.7 are interpreting differently what to do when
an object has more than one media with differing "samples" settings. The
question would be whether either one is doing the right thing. If one of
the medias has been specified to need a higher amount of samples, and if
povray nevertheless renders it with a lower amount because the other media
had that lower amount, it would seem to be the wrong thing to do. From those
timings I deduce that both versions are doing the wrong thing, just in the
opposite way: One is taking the samples from the first media and the other
is taking them from the second one, regardless of whether they are different
from each other or not.

//---------------------------------------------------------------------
// 0 = no "samples", 1 = first media has "samples"
// 2= second media has "samples", 3 = both have "samples
#declare Mode = 3;

camera { location -z*5 look_at 0 angle 35 }
sphere
{ 0, 1
  hollow
  pigment { transmit 1 }
  interior
  { media
    { emission 1
      density
      { spherical density_map
        { [0 rgb 0]
          [1 rgb x]
        }
        scale 10
        warp { turbulence .1 }
        scale 1/10
        warp { turbulence .1 }
      }
      #if(Mode = 1 | Mode = 3)
        samples 50,100
      #end
    }
    media
    { emission 1
      density
      { spherical density_map
        { [0 rgb 0]
          [1 rgb y]
        }
      }
      #if(Mode > 1)
        samples 50,100
      #end
    }
  }
}
//---------------------------------------------------------------------


-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: Strange speed differences between 3.6 and 3.7 with complex media
Date: 29 Aug 2009 16:13:25
Message: <4a998be5$1@news.povray.org>
Warp schrieb:
>   It seems that 3.6 and 3.7 are interpreting differently what to do when
> an object has more than one media with differing "samples" settings. The
> question would be whether either one is doing the right thing. If one of
> the medias has been specified to need a higher amount of samples, and if
> povray nevertheless renders it with a lower amount because the other media
> had that lower amount, it would seem to be the wrong thing to do. From those
> timings I deduce that both versions are doing the wrong thing, just in the
> opposite way: One is taking the samples from the first media and the other
> is taking them from the second one, regardless of whether they are different
> from each other or not.

According to the code, POV-Ray does take the settings from what it deems 
the most demanding media (except for the AA threshold, for this it 
searches independently for the smallest value); if all media appear just 
as demanding to POV-Ray, it will pick one more or less at random (the 
behavior in this has probably changed in the wake of changing the 
respective list's data type to a C++ container class).

The problem in this particular case is that POV-Ray's only criterion for 
determining which media is the most "demanding" is the number of intervals.

There is /some/ reason to it: After all, what if a medium has lower 
number of samples but higher number of intervals? What if both min and 
max samples are specified? What if they use different sampling methods? 
Coming up with a good set of rules is not so trivial.


Post a reply to this message

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