POV-Ray : Newsgroups : povray.advanced-users : function select logic : Re: function select logic Server Time
24 Apr 2024 01:33:53 EDT (-0400)
  Re: function select logic  
From: scott
Date: 23 Nov 2016 10:40:14
Message: <5835b85e$1@news.povray.org>
>> That's just going to decide whether or not to declare the functions in
>> the scene, on some unrelated RGB variables (RGB in the function
>> definitions are just parameters). It won't affect the behaviour of the
>> function when it is actually used later on (apart from getting an error
>> that it is undefined).
>
> Well that was the "or..." part of the "do nothing" conditional result.
> #declare RGB = color rgbt <1, 1, 1, 1>;
>
> would be a default "hide / 'discard' this out of range result"

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.

Using the transmit channel is a good idea though. You could define 
another function for calculating the transmit value, that just returns 1 
if any of RGB parameters are out of range, or zero otherwise. This needs 
to be a select statement inside a function though, not using #if.


Post a reply to this message

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