POV-Ray : Newsgroups : povray.advanced-users : Question about photons : Re: Question about photons Server Time
29 Jul 2024 20:25:58 EDT (-0400)
  Re: Question about photons  
From: Warp
Date: 7 Feb 2001 12:45:20
Message: <3a8189b0@news.povray.org>
Jan Walzer <jan### [at] lzernet> wrote:
: Is that true ??? I don't believe it ... Why don't they use these Rays again
: ???
: They are already computed, and mostly they are on the right position ...

  When the mosaic preview option was first introduced (I think it was in
3.0, or was it even before that? I don't remember), 8 megabytes of RAM was
a really huge amount of memory.
  If you think about what you need in order to be able to reuse the pixel
values of the mosaic preview step, you'll see that in practice you'll have
to keep the entire image in memory. It's not only necessary in order to be
able to save the whole image to disk in the right order but also for things
like antialiasing (antialiasing needs the nearby pixels in order to
calculate the antialiasing threshold).
  POV-Ray has always been designed to be able to create any sized images.
For example creating a 1600x1200 sized image with alpha channel should not be
a problem.

  Now, how much memory does this image take?
  This depends a lot in how do we store the image in memory. The obvious
answer "1 byte per color component" is not as obvious as one could think.
  AFAIK the antialiasing threshold needs floating point numbers to compare
whether the threshold is reached or not. This floating point number
(representing one channel of the pixel) is in the range between 0 and 1.
A byte per color component would give 256 steps between 0 and 1. Well, this
might be enough, or not. This would mean that "+a0.005" would be the same
as "+a0" although it shouldn't.

  Even if we use just 1 byte per color channel, that would be 4 bytes per
pixel in the worst case (that is, alpha channel is used). 1600x1200 pixels
take, thus, 7680000 bytes = 7.3 Megabytes.
  (If we have to use floating point numbers for the color channels and
a float takes 4 bytes, then one pixel would take 16 bytes and the whole
image would take 30720000 bytes = 29.3 Megabytes.)

  When we have 8 megs of RAM, using 7.3 Megs for the image doesn't sound like
a good option.

  Of course nowadays the situation is completely different. 128 Megs of RAM
is not unusual at all.
  However, modifying the mosaic preview code would require some work and
I suppose that the team has its hands full of more important work already.
This kind of optimization has quite low priority, after all.

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

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