POV-Ray : Newsgroups : povray.general : AA adaptive +am2? : Re: AA adaptive +am2? Server Time
3 Aug 2024 06:15:02 EDT (-0400)
  Re: AA adaptive +am2?  
From: Slime
Date: 1 May 2004 20:12:52
Message: <40943d04$1@news.povray.org>
> Hmm try rendering an empty scene with atialias options
>
> +a0.03 +am2 +r90 +w320 +h240
>
> this scene is rendering terrible slow (few minutes on 2 GHz), isnt there
> something wrong with AA code?

OK, I looked at the 3.5 source code and I think I found what causes it:

[line 1549 of render.cpp]

      /* Initialize current block */

      for (yy = 1; yy < sub_pixel_size + 1; yy++)
      {
        for (xx = 1; xx < sub_pixel_size + 1; xx++)
        {
          Block[yy][xx].active = false;
        }
      }


The inner line of that loop is executed 263169 times with +R9. It
initializes every single possible sample that could be taken as "sample
hasn't been taken yet".

If this is indeed the source of the slowdown, then it could be easily fixed.
This loop can be removed in favor of initializing only the samples which
will be used by the first call of the trace_sub_pixel function (this will be
the 4 samples that are at the corners of the pixel, which means the loop can
be replaced with a single statement because only the lower-right such sample
needs to be initialized, I believe - for the same reason that xx and yy
start at 1 and not 0).

Then, when trace_sub_pixel recurses, it must initialize the new center
sample which will be used by the recursive calls.

If this loop is the problem then I think that will fix it.

(By the way, there doesn't seem to be any memory allocation except for at
the very beginning of the trace.)

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


Post a reply to this message

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