POV-Ray : Newsgroups : povray.general : Weirdnesses with function patterns : Re: Weirdnesses with function patterns Server Time
29 Jul 2024 00:30:42 EDT (-0400)
  Re: Weirdnesses with function patterns  
From: David Given
Date: 8 Dec 2013 19:24:44
Message: <52a50dcc$1@news.povray.org>
On 08/12/13 23:00, clipka wrote:
[...]
> Yes, of course. There's no pattern involved here, so why should there be
> any clipping or wrapping?

Oh, yes, my bad. What I should have said was that this:

	pigment {
		pigment_pattern {
			rgb <100, 100, 100>
		}
		frequency 0
		pigment_map {
			[0.0 rgb <0, 0, 0>]
		}
	}

...results in an out-of-bound value (of 100) being passed to
Search_Blend_Func() --- pigment_pattern() doesn't clip the greyscale
value before returning it.

As the default frequency is 1, which causes the value to be wrapped, I
can't imagine this every actually happening in real life, but I still
noticed it when I was looking at the code.

That's not really related to my earlier comment, though. Can I reiterate
my plea for more visible documentation that function patterns should
only return values from 0 to 1? As you might have gathered, this wasn't
obvious!

-- 
┌─── dg@cowlark.com ─────
http://www.cowlark.com ─────
│ "There does not now, nor will there ever, exist a programming
│ language in which it is the least bit hard to write bad programs." ---
│ Flon's Axiom


Post a reply to this message

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