|
|
>> I think you misunderstand my point. Any #if, #declare etc will only get
>> evaluated once when the scene is parsed. You'll end up with either your
>> function declared or not declared. When you come to use that function in
>> a pigment or isosurface or whatever your #if #declare statements won't
>> be executed again. Any logic needs to go inside the function declaration
>> using the select function, not #if.
>
> True.
> Though I was looking at "equations" not any declared functions.
If this is the case then it's very easy, no need to use any functions or
select at all ... sorry, blatant copy&paste of your example :-)
#if (R>1 | R<0 | G>1 | G<0 | B>1 | B<0)
// do nothing, or whatever else you want
#else
// we know here that RGB are all within the 0...1 range, so no need
// to clamp with min/max
object{ blah blah pigment{ color rgb <R,G,B>} }
#end
But I got the impression from Mike's post that he needed a function to
do this for use later (maybe in a pigment?).
Post a reply to this message
|
|