POV-Ray : Newsgroups : povray.beta-test : Syntax error message? Server Time
25 Apr 2024 19:12:00 EDT (-0400)
  Syntax error message? (Message 1 to 3 of 3)  
From: Thomas de Groot
Subject: Syntax error message?
Date: 7 Dec 2012 03:47:24
Message: <50c1ad1c$1@news.povray.org>
In an external .inc file I have the following line:

#declare srgbLightTanned1 = srgb <226, 167, 135>/255;

In my material definition I have written, using Poseray's macros:

#declare SkinColor = srgbLightTanned2;

#declare PP_Head = pigment {pigment_multiply(p_map7,pigment {srgb 
SkinColor})}

...which should be written without the /srgb/ code to be correct:

#declare PP_Head = pigment {pigment_multiply(p_map7,pigment {SkinColor})}

Both lines render without a glitch but give very different render results.

Should there not be a warning message telling about the extra and 
unwanted srgb code?

Thomas


Post a reply to this message

From: clipka
Subject: Re: Syntax error message?
Date: 7 Dec 2012 07:21:14
Message: <50c1df3a@news.povray.org>
Am 07.12.2012 09:47, schrieb Thomas de Groot:
> In an external .inc file I have the following line:
>
> #declare srgbLightTanned1 = srgb <226, 167, 135>/255;
>
> In my material definition I have written, using Poseray's macros:
>
> #declare SkinColor = srgbLightTanned2;
>
> #declare PP_Head = pigment {pigment_multiply(p_map7,pigment {srgb
> SkinColor})}
>
> ....which should be written without the /srgb/ code to be correct:
>
> #declare PP_Head = pigment {pigment_multiply(p_map7,pigment {SkinColor})}
>
> Both lines render without a glitch but give very different render results.
>
> Should there not be a warning message telling about the extra and
> unwanted srgb code?

Not really; for instance, you might be using a legacy 3rd-party include 
file, designed for a "assumed_gamma 2.2" scene, specifying

     #declare SkinColor = rgb <226, 167, 135>/255;

In that case, you'd very likely want to convert that to whatever 
assumed_gamma you're using; that's where specifying

     srgb SkinColor

does makes sense.

Note that colors specified with the "srgb" keyword are not a different 
flavor of color - they're converted "on the spot" into regular rgb 
colors. So the parser cannot catch a double application of the srgb keyword.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Syntax error message?
Date: 7 Dec 2012 08:24:41
Message: <50c1ee19@news.povray.org>
On 7-12-2012 13:21, clipka wrote:
> Not really; for instance, you might be using a legacy 3rd-party include
> file, designed for a "assumed_gamma 2.2" scene, specifying
>
>      #declare SkinColor = rgb <226, 167, 135>/255;
>
> In that case, you'd very likely want to convert that to whatever
> assumed_gamma you're using; that's where specifying
>
>      srgb SkinColor
>
> does makes sense.
>
> Note that colors specified with the "srgb" keyword are not a different
> flavor of color - they're converted "on the spot" into regular rgb
> colors. So the parser cannot catch a double application of the srgb
> keyword.
>

OK. Understood and makes sense. I have to watch my own code corrections 
while writing and editing ;-)

Thanks Christoph!

Thomas


Post a reply to this message

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