POV-Ray : Newsgroups : povray.general : I was wrong, image_pattern looks useful. Attn: Bald Eagle. : Re: I was wrong, image_pattern looks useful. Attn: Bald Eagle. Server Time
25 Apr 2024 18:37:58 EDT (-0400)
  Re: I was wrong, image_pattern looks useful. Attn: Bald Eagle.  
From: William F Pokorny
Date: 14 Mar 2023 19:11:47
Message: <6410ff33$1@news.povray.org>
On 3/14/23 04:17, Kenneth wrote:
> There is also something in the link below that proved useful to*me*  in 2020
> (near the end of the thread), about pigment_pattern vs image_pattern, with the
> former actually being more 'user-friendly' when coding complex textures. Near
> the middle of the thread, IVE mentioned the reason, in response to a question I
> had (not about height_fields though.)

Thanks for the pointer! I vaguely remember the thread and I gave it a 
re-read. I've been playing with image_pattern vs image_map.

It certainly pays to defined a pigment containing either the image_map 
or image_pattern once and to thereafter reference that pigment. If your 
eventual use is 'grey' via pigment_pattern or a function's .gray I think 
  the two image inputs are mostly interchangeable. I see little 
difference for storage. There looks to be a slight performance advantage 
to using image_pattern in the once defined pigment especially with the 
function's reference being then .red. The function wrapper itself 
slightly slower the pigment_pattern.

FWIW. My test code is at the core roughly:

//---
#declare Pim = pigment { image_map { "as789.png" } }
#declare Pip = pigment { image_pattern { "as789.png" gamma srgb } }
#declare FPim = function { pigment {Pim} }
#declare FPip = function { pigment {Pip} }

#declare P000 = pigment {
//  color Red
//  image_map { "as789.png" }
//  image_pattern { "as789.png" }
//  Pim
     Pip
     //---
//  pigment_pattern { Pim }
//  pigment_pattern { Pip }
//  function { FPim(x,y,z).gray }
//  function { FPip(x,y,z).red }
//  color_map { [0 red 0] [1 red 1] }
}
//---

Bill P.


Post a reply to this message

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