|
|
Thomas de Groot <tho### [at] degrootorg> wrote:
> Op 04/10/2020 om 07:38 schreef Kenneth:
> >
> > Alas, the macro does not 'pre-#declare' the image_map in a similar way, or
> > save on memory usage.
> >
> Hmmm... yes, that would not work as expected I guess. However, It seems
> there would be little gain in such a construct, would there? A simple
> declaration of the pigment image_map is enough...
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...
// 1 of 34
#macro HO_7() // the window hold-out mask
jpeg "building windows 7 HO.jpg" interpolate 2 // not *quite* a complete
// pigment{image_map{...}} specification, but necessary this way. And with
// no memory savings :-(
#end
#declare TEX_MAP_FOOBAR = // a special preliminary texture
texture_map{
// no *pattern* here as per docs, because this will be used as part of
// the texture{image_pattern{...}} below
[.45 TEX_F_B] // the regular *visible* building image_map tile with
/ /its bricks, windows, etc.
[.55 TEX_REFLECT] // the same image_map tile but with REFLECTION
// all over it
}
then...
#declare MY_TEMP_TEX =
texture{
image_pattern{
#switch(true)
....
#case(....) // 34 of these
HO_7() } // inserting the macro, with an ending bracket here
#break
....
#else
#end
texture_map{TEX_MAP_FOOBAR} // the regular *visible* texture for each
// building, but now masked by the window hold-out image so that only the
// windows have reflection
} // end of MY_TEMP_TEX texture
This probably doesn't make much sense out-of-context-- and *using* it later in a
BOXED pattern is even more complex to describe. 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.
Post a reply to this message
|
|