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 01:15:48 EDT (-0400)
  Re: city buildings as height_fields-- WIP 1  
From: Bill Pragnell
Date: 1 Mar 2018 05:45:00
Message: <web.5a97d817e5be66e21b6c6b3a0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> And yes, image-based pigments do indeed share the actual image data
> among instances.

Excellent. I'd have been surprised if that wasn't the case, but I never actually
knew for certain!

So then, here's an example of what I was talking about for Kenneth:

#declare Filenames = array[3] {
  "FileName1.jpg",
  "FileName2.jpg",
  "FileName3.jpg"
}
#declare Pigments = array[3];
#for (I, 0, 2)
  #declare Pigments[I] = pigment {
    image_pattern {
      jpeg Filenames[I]
    }
  }
#end

#declare S = seed(0);

// Now do the below a bajillion times and hopefully
// you'll only be using memory for the 3 images
// plus the pigment instance:

#declare RandI = floor(rand(S)*2.99);
box { -1, 1 pigment { Pigments[RandI] } finish { ambient 0 } }


Post a reply to this message

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