POV-Ray : Newsgroups : povray.beta-test : SUGGESTION: Saving Memory: Images : SUGGESTION: Saving Memory: Images Server Time
25 Apr 2024 13:59:43 EDT (-0400)
  SUGGESTION: Saving Memory: Images  
From: Sven Littkowski
Date: 16 Dec 2015 04:18:19
Message: <56712c5b@news.povray.org>
Hi,

I learned from other users, that declaring an image file (that is being
used for multiple textures) within a pigment and then using this pigment
in these textures, would save memory as it prevents that the same image
is being loaded multiple times into the memory.

Well, now I tried to optimize my scene source code.

Since the same bump_map image is used for a planar and also for a
spherical projection, I tried to declare the bump_map, too:
#declare Bump = bump_map { "Seneca II - Hull Bump NoGates.png" }

And then using it multiple times:
#declare BPL04 = normal { bump_map { Bump bump_size 0.4 } }
#declare BPL10 = normal { bump_map { Bump bump_size 1.0 } }
#declare BSP04 = normal { bump_map { Bump map_type 1 bump_size 0.4 } }

I also thought, that I could optimize (minimize image loading amounts)
this way:
#declare Car = image_map { jpeg "Seneca II - Hull Plating.jpg" }

And then using it multiple times:
#declare CarPL = pigment { image_map { Car             interpolate 2 } }
#declare CarSP = pigment { image_map { Car  map_type 1 interpolate 2 } }

But planet Earth would be a paradise, if things would be that easy. But
they aren't. POV-Ray returned an error saying "rvalue expected but
something else found".

Thus my suggestion to the magnificent POV-Ray developer team, to allow
such declarations. I believe, this could reduce memory usage further by
preventing having to load the same image multiple times just because the
map-type or any other modifier differs slightly. I would like to get
some feedback of other users and surely of the developers, if possible.
Thanks for your time, reading, good intentions and answering. :-D


Post a reply to this message

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