POV-Ray : Newsgroups : povray.binaries.images : city buildings-- WIP 9_29_2020 : Re: city buildings-- WIP 9_29_2020 Server Time
9 May 2024 22:50:05 EDT (-0400)
  Re: city buildings-- WIP 9_29_2020  
From: Kenneth
Date: 4 Oct 2020 05:15:00
Message: <web.5f7991cf32341a55d98418910@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> ...But the point is, POV-ray's
> texture{image_pattern...}} construct requires a specific and rather odd syntax
> for its hold-out-mask image-- which makes a random substitution of that image
> difficult, with no way that I have found to pre-#declare the image so that it
> isn't loaded into memory over and over again (when used in a #while loop). In
> fact, macro substitution is the only way I've found to successfully do it at
> all, regardless of the memory-use problem.

Hmm... I just thought of what *might* be another way around this problem,
another complex way (ouch), but I haven't tried it yet. Some psuedo-code:

1) PRE-#declare the 34 hold-out-mask images *as* the rather odd macros, to
hopefully save memory use later when they are used repeatedly:
#declare H_O_IMAGE_1 =
#macro FOOBAR_1() // to create each macro
png "my_holdout_mask_1.png" interpolate 2
#end
.... 2,3,4, etc
Perhaps #declaring these macros will work as I imagine(?)

2) For the final texture{image_pattern{...}}, pre-make 34 *different* and
complete image_pattern{...} constructs(!)-- which include the pre-#declared
macros from 1):

#declare IMG_PATTERN_1 =
image_pattern{ //this *should* work as syntax, like  pigment{...} in a #declare
   H_O_IMAGE_1
   texture_map{TEX_MAP_FOOBAR} // this has been pre-#declared too
             }

3) Substitute those 34 image_patterns randomly into the final texture... which
should save a lot of memory use:
texture{
     image_pattern{ // proper syntax?
         #switch(true)
         #case(...)
         IMG_PATTERN_1
         #break
         ... etc.
         #else
         #end
       }

I should give it a try, at least to see if all of the syntax works properly.


Post a reply to this message

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