POV-Ray : Newsgroups : povray.general : SDL processing speed : Re: SDL processing speed Server Time
3 May 2024 22:37:47 EDT (-0400)
  Re: SDL processing speed  
From: Kenneth
Date: 25 Apr 2018 17:30:01
Message: <web.5ae0f0deaf45eceba47873e10@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

> > Thanks for the clairification about macro caching. I know it's been
> > mentioned before, but I wasn't clear about the details-- the exact
> > memory limit. I
> > assume(?) that the caching occurs for *any* entity placed in the
> > macro... even a pigment{image_map...} for example (just so it's under
> > the 64K limit).
>
> Just to be clear: It's not the /result/ of the macro that is cached -
> just the SDL code snippet.

Oh! I think I see now. So with the following silly example...

#macro FOO()
30.716 + 57.362 - 11.602
#end

....... it's not the total result or even the math operations that are preformed
or
cached, it's just the bytes representing 3,0,7,1,6, etc (and whatever the byte
designations of "=" and "-" and the decimal points are). In other words, the
macro is just a 'container' to cache those data bytes...with a 64K maximum
storage limit for the bytes.  Am I correct?

And I'm guessing that anything in the macro over 64K-- any 'remainder bytes'--
are not actually cached, although they are still a useful part of the macro and
are still used later somehow, when the macro is invoked. (?)  Or does a macro
have a HARD 64K limit, that can't be exceeded? (That's a lot of  bytes, of
course!)

---
About the image_map example...
> >
> > pigment {
> >     image_map {
> >       function 500,500 {
> >         pigment {image_map{png "MY_IMAGE.png} }
> >                        }
> >               }
> >         }
>
>
> ...
> However, at second glance, the construct is still interesting, albeit
> for another reason: Nobody stops you from specifying a resolution in the
> function image that differs from the image function; so you can use it
> to re-sample the image.
>
> Since the function can be discarded right after the function image has
> been constructed, and the underlying original image can be discarded
> along with it, this may reduce the memory footprint of a scene if your
> image has a very high resolution but you only need a very low resolution.

Ah, OK.
Then a more conceptually useful 'cached function' memory-saving example would
be...

pigment {
     average
     pigment_map{
           [1 bozo]
           [1
            image_map {
                 function 27,27 {
                 pigment {image_map{png "MY_IMAGE.png"}}
                // The image itself is, say, 3000 X 3000 pixels
                                }
                      }
           ]
                }
        }

So the image_map function here would have a very-much-reduced memory footprint,
compared to the original gigantic image.


Post a reply to this message

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