POV-Ray : Newsgroups : povray.unofficial.patches : Why does POV-Ray allocate so many memory blocks for textures? : Re: Why does POV-Ray allocate so many memory blocks for textures? Server Time
28 Jun 2024 14:51:42 EDT (-0400)
  Re: Why does POV-Ray allocate so many memory blocks for textures?  
From: Christopher James Huff
Date: 9 Jun 2003 12:17:02
Message: <cjameshuff-06BC08.11082809062003@netplex.aussie.org>
In article <3ee40ca7@news.povray.org>,
 "Ray Gardener" <ray### [at] daylongraphicscom> wrote:

> I asked this before but no one explained it fully.
> Mr. Froehlich mentioned something about Knuth,
> numerous potential texture accesses during raytracing,
> and implied that the answer should be patently obvious.

It is obvious. What you are doing is called "premature optimization".


> When POV loads a texture, it allocates a memory block
> for each color channel and scanline of the image.
> So a 256 pixel tall 24-bit RGB texture would take
> 256 x 3 = 768 memory blocks. I can't imagine that
> this

No, it does that when it loads an image. And so what? It's a convenient 
way to store images, though a little more work to allocate and free. 
There is probably no (non-trivial) scene in existence where you would 
get a useful speedup by implementing something else. Image allocation 
time is not an issue, looking at it is a waste of programmer time.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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