POV-Ray : Newsgroups : povray.beta-test : Gamma in POV-Ray 3.6 vs. 3.7 : Re: Gamma in POV-Ray 3.6 vs. 3.7 Server Time
5 Oct 2024 00:39:30 EDT (-0400)
  Re: Gamma in POV-Ray 3.6 vs. 3.7  
From: clipka
Date: 12 Sep 2009 05:42:36
Message: <4aab6d0c@news.povray.org>
Le_Forgeron schrieb:

> why not go utf-8 and use a real gamma γ or Γ ? (aaos)

Cumbersome to input on most machines (as I already mentioned, I 
personally wouldn't mind, because I'd intend to stick mostly to linear 
colors anyway, but I'd expect some people to think otherwise :-)), let 
alone that POV-Ray's support for utf-8 is rather... well, let's call it 
"marginal" ;-)

(BTW, I need to correct my initial tongue-in-cheek suggestion of \u393 
in favor of \u3B3, as the uppercase Gamma would be inappropriate, being 
reserved for other mathematical purposes...)

> I stand by my idea of a s- prefix to rgb/rgbt/rgbf/.../red/green/blue
> If it is need to be able to set the gamma factor, a prefix is better:
> 
> color srgb <2.2,1.0,0.5,0.25>
> 
> Only issue, we would end up with 6D vectors (srgbtf)... a bit long,
> isn't it ?
> 
> 'S' prefix, for similarity to current sRGB model, and S is available letter.

I thought about it again, and I come to the conclusion that a prefix 
operator would be much more flexible, allowing to use it on scalars and 
vectors that happen to need some (linear) math to be applied to them way 
before being "promoted" to actual colors, while also retaining the 
ability to use it no sooner than when the value is actually used.

It would even allow for uses such as (using the symbol "@" as the gamma 
operator here):

     #declare MyColor = color rgb <0.5,0.5,0.5>;
     ...
     pigment { @MyColor }

As most colors will be from the same "gamma space", a 
global_settings{...} or - possibly better - default{...} parameter 
should be enough to specify the gamma to be used for that operator. This 
will reduce redundant typing effort, and will also improve legibility 
("duh, is that a 5D or 6D vector??"). Note that it could be changed 
anytime if needed (though I guess it would have to be local to any 
include file to avoid trouble). For exceptional cases, an explicit 
"gamma(COLOR,g)" function might be provided.

Or, maybe an extended syntax can be used for the operator, such as in:

     default { gamma 2.2 }

     color rgb @<0.5,0.5,0.5>     // for default gamma
     color rgb @[1.8]<0.5,0.5,0.5> // for explicit gamma

(note that a square brackets block by itself is no valid expression, so 
there would be no ambiguity with the other uses of square brackets), or:

     color rgb @1.8:<0.5,0.5,0.5>


Post a reply to this message

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