POV-Ray : Newsgroups : povray.binaries.images : city buildings-- WIP 9_29_2020 : Re: city buildings-- WIP 9_29_2020 Server Time
20 May 2024 12:56:34 EDT (-0400)
  Re: city buildings-- WIP 9_29_2020  
From: Ive
Date: 4 Oct 2020 10:39:29
Message: <5f79dea1$1@news.povray.org>
Am 10/4/2020 um 9:46 schrieb Kenneth:
> Yes, that is true in most cases-- probably 99% of cases! But my scene makes use
> of a repetitive (and randomly-configured) texture{image_pattern...) as a
> 'hold-out mask' for creating the many building windows' reflections; one texture
> is used to mask another texture.  The best way-- the only way(?)-- that I could
> come up with to make it work in my scene was to use a rather odd-looking macro
> for substitution in the texture{image_pattern...}. Like this, one of 34 similar
> examples of my macro at present...
> 

Just do not use the "texture_map" construct (as you say it has an odd 
syntax making it impossible to pre-declare the used image maps), use 
"pigment_pattern" instead. Like so:

#declare C_map_01 = pigment {image_map {png  "cutout01" }};

#declare T_01 = texture {
   pigment { whatever ... }
   finish { whateever ... e.g with reflection }
}

#declare T_02 = texture {
   pigment { whatever... }
   finish { whateever ... e.g. without reflection }
}


#declare T_01 = texture {
   pigment_pattern {C_map_01}
   texture_map {
      [0 T_01]
      [1 T_02]
   }
}


You can use this construct within macros, switch clauses or wherever you 
want to and the image files are loaded only once - while reducing memory 
usage and parse time.
I myself visit these NG only every few months and with most "veterans" 
gone some wisdom seems to be lost. But 15 years ago it was common 
knowledge to use pigment_map for all kind of things like finish maps, 
opaticity maps, emission maps and what have you.

-Ive


Post a reply to this message

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