|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I've written the following macro to tweak some color values:
#macro gamma_color_adjust(in_color, in_transmit)
#local out_gamma = 2.2;
#if (in_transmit)
VPow(in_color,out_gamma) + <0,0,0,in_transmit,>
#else
VPow(in_color,out_gamma)
#end
#end
The macro takes a three component color vector as the first parameter,
and a single transmit parameter as the second parameter. I keep getting
the error, "Expected 6 parameters but only 5 found." What did I do wrong?
--
http://isometricland.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 09.06.2010 23:22, schrieb SharkD:
> I've written the following macro to tweak some color values:
>
> #macro gamma_color_adjust(in_color, in_transmit)
> #local out_gamma = 2.2;
> #if (in_transmit)
> VPow(in_color,out_gamma) + <0,0,0,in_transmit,>
> #else
> VPow(in_color,out_gamma)
> #end
> #end
>
> The macro takes a three component color vector as the first parameter,
> and a single transmit parameter as the second parameter. I keep getting
> the error, "Expected 6 parameters but only 5 found." What did I do wrong?
Not sure what's wrong there (sounds pretty strange), but I suggest a
different approach to the macro anyway:
#macro Gamma_Adjust(In_Color)
#local Out_Gamma = 2.2;
rgbft <
pow(In_Color.red, Out_Gamma),
pow(In_Color.green, Out_Gamma),
pow(In_Color.blue, Out_Gamma),
In_Color.filter,
In_Color.transmit
>
#end
Using three separate calls to pow isn't any slower than VPow (actually
it's faster, because VPow is just another macro that itself calls pow
thrice), and you also don't need separate parameters; just replace (e.g.)
color rgbt <R,G,B,T>
with
color Gamma_Adjust( rgbt <R,G,B,T> )
It should work with any color literal syntax you can imagine, such as
"color red R", "color rgb GREY filter F", "color rgbft <R,G,B,F,T>", or
what-have-you.
(BTW, I suggest using Mixed_Case identifiers for anything you name
yourself, as lower_case identifiers pose a risk of conflicting with
future SDL keywords.)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
SharkD <pos### [at] gmailcom> wrote:
> I've written the following macro to tweak some color values:
>
> #macro gamma_color_adjust(in_color, in_transmit)
> #local out_gamma = 2.2;
> #if (in_transmit)
> VPow(in_color,out_gamma) + <0,0,0,in_transmit,>
> #else
> VPow(in_color,out_gamma)
> #end
> #end
>
> The macro takes a three component color vector as the first parameter,
> and a single transmit parameter as the second parameter. I keep getting
> the error, "Expected 6 parameters but only 5 found." What did I do wrong?
>
>
> --
> http://isometricland.com
I didn't try it, but I noticed that there is a trailing comma after in_transmit,
which could make povray think that there should be another value. If this is a
direct copy&paste, double check that comma.
HTH
-Reactor
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 6/9/2010 6:50 PM, Reactor wrote:
> I didn't try it, but I noticed that there is a trailing comma after in_transmit,
> which could make povray think that there should be another value. If this is a
> direct copy&paste, double check that comma.
>
> HTH
> -Reactor
>
>
IIRC, trailing commas after vector components are legal. I will try
without though.
--
http://isometricland.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 6/9/2010 6:39 PM, clipka wrote:
> It should work with any color literal syntax you can imagine, such as
> "color red R", "color rgb GREY filter F", "color rgbft <R,G,B,F,T>", or
> what-have-you.
>
> (BTW, I suggest using Mixed_Case identifiers for anything you name
> yourself, as lower_case identifiers pose a risk of conflicting with
> future SDL keywords.)
It didn't work for me, in 3.6 at least. Example:
#macro Gamma_Adjust(In_Color)
#local Out_Gamma = 2.2;
rgbft <
pow(In_Color.red, Out_Gamma),
pow(In_Color.green, Out_Gamma),
pow(In_Color.blue, Out_Gamma),
In_Color.filter,
In_Color.transmit
>
#end
#declare test_color = Gamma_Adjust(<1,1,1>);
Results in an "Bad operands for period operator" error.
--
http://isometricland.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"SharkD" <pos### [at] gmailcom> schreef in bericht
news:4c102e92$1@news.povray.org...
> Results in an "Bad operands for period operator" error.
You certainly have seen my thread in povray.general: "Bad operands", on
20-5-2010? :-)
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 10.06.2010 02:15, schrieb SharkD:
> On 6/9/2010 6:39 PM, clipka wrote:
>> It should work with any color literal syntax you can imagine, such as
>> "color red R", "color rgb GREY filter F", "color rgbft <R,G,B,F,T>", or
>> what-have-you.
>>
>> (BTW, I suggest using Mixed_Case identifiers for anything you name
>> yourself, as lower_case identifiers pose a risk of conflicting with
>> future SDL keywords.)
>
> It didn't work for me, in 3.6 at least. Example:
>
> #declare test_color = Gamma_Adjust(<1,1,1>);
>
> Results in an "Bad operands for period operator" error.
<1,1,1> is not a color (=5D vector), but a 3D vector. Try this instead:
#declare test_color = Gamma_Adjust( rgb <1,1,1> );
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 6/10/2010 3:04 AM, Thomas de Groot wrote:
> "SharkD"<pos### [at] gmailcom> schreef in bericht
> news:4c102e92$1@news.povray.org...
>> Results in an "Bad operands for period operator" error.
>
> You certainly have seen my thread in povray.general: "Bad operands", on
> 20-5-2010? :-)
>
> Thomas
>
>
No, I didn't. Was the problem ever resolved?
--
http://isometricland.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I changed the macro to this and it seems to work OK:
#macro gamma_color_adjust(in_color)
#local out_gamma = 2.2;
#local in_color = in_color + <0,0,0,0,0>;
<
pow(in_color.red, out_gamma),
pow(in_color.green, out_gamma),
pow(in_color.blue, out_gamma),
in_color.filter,
in_color.transmit
>
#end
--
http://isometricland.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"SharkD" <pos### [at] gmailcom> schreef in bericht
news:4c11ae92@news.povray.org...
>
> No, I didn't. Was the problem ever resolved?
>
Yes. Clipka explained it all very well there.
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|