POV-Ray : Newsgroups : povray.binaries.images : city buildings as height_fields-- WIP 1 : Re: city buildings as height_fields-- WIP 1 Server Time
2 May 2024 03:29:06 EDT (-0400)
  Re: city buildings as height_fields-- WIP 1  
From: Bill Pragnell
Date: 1 Mar 2018 04:05:00
Message: <web.5a97c111e5be66e21b6c6b3a0@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> Let's say I have 50 different pigments:
>
> pigment{image_map{jpeg "building windows *number*.jpg}}
>
> So sticking them into an array actually #declares them-- once into memory-- then
> I can call those pigments as many times as I want without increasing memory
> usage. Just like pre-#declaring all of them individually.

Well I know that's true for meshes, but I'm not sure about texture images. I
would hope that if I'm talking rubbish here, clipka would step up to correct me!
My suggestion was more about avoiding excessive brute-force declarations.

> Sorry to say, I thought arrays were just 'containers'  :-O  I've never put any
> memory-hogging things into one.

Each array element can be thought of as an lvalue in a #declare.

> But in the case of my image_pattern-- which uses just
>        jpeg "building windows *number*.jpg"
>
> ....I'm still not *totally* convinced that the image itself has actually been
> #declared by the array...mainly because there's no pigment or image_map
> 'wrapper' around it. It looks like an 'unfinished entity.' Your thoughts?

Sorry, I should have been a bit less concise! I was suggesting putting the
filenames into an array of strings to cut down on bruteforce code, then using
that array to populate another array of pigment blocks (which can be automated).
Each pigment block definition reads the image file, then you can use those
pigments wherever you want. This is the same as laboriously declaring each
image-based pigment by name, but because you can loop over an array, or pick a
random index to choose one, it makes the whole thing easier to use.

I'll knock up some example code later if you like.

hope that helps!
Bill


Post a reply to this message

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