Scalar to Boolean Scalar: Difference between revisions

From Terragen Documentation from Planetside Software
Jump to navigation Jump to search
jrfconvert import
 
No edit summary
Line 3: Line 3:


[[Image:drex_module_125_image_0.png|485pxpx|Scalar to Boolean Scalar]]
[[Image:drex_module_125_image_0.png|485pxpx|Scalar to Boolean Scalar]]
'''Node Description & Purpose: ''' The Scalar to Boolean scalar node converts a scalar value to a Boolean scalar value. A Boolean has a value of either 1 or 0. There is an optional Threshold value which lets you control how the conversion to a Boolean value happens.<br /><br /> The default conversion, without using a threshold value, is that the Input value is converted to 0 if it equals 0, and it is converted to 1 if it is not equal to 0. As an example:<br /><br />'''Input''' of 0 '''becomes''' 0<br />'''Input''' of 0.5 '''becomes''' 1<br />'''Input''' of 2 '''becomes''' 1<br />'''Input''' of -0.5 '''becomes''' 1<br /><br /> Optionally, you can control the conversion to a Boolean by using a threshold value. In this case the Input value is converted to 0 if it is less than the threshold value, and converted to 1 if it is greater than or equal to the threshold value. As an example, using a threshold value of 2 :<br /><br />'''Input''' of 0 '''becomes''' 0 ( 0 is less than 2 )<br />'''Input''' of 0.5 '''becomes''' 0 ( 0.5 is less than 2 )<br />'''Input''' of 2 '''becomes''' 1 ( 2 is greater than or equal to 2 )<br />'''Input''' of 6 '''becomes''' 1 ( 6 is greater than or equal to 2 ) <br />'''Input''' of -0.5 '''becomes''' 0 ( -0.5 is less than 2 )<br /><br />'''Node Type: '''Function<br /><br />'''Settings: '''<br />
* '''Use threshold value: '''If this check box is checked then the supplied threshold value is used to convert the scalar to a Boolean.
* '''Threshold value: '''This is the value that is used for the threshold value, as described above.
<br />'''Error conditions:'''<br />
* It is an error for there to be no '''Input''' value. In that case 0 is output from the node.
* It is an error for there to be no '''Threshold value''' shader connected when the '''Use threshold value''' check box is checked. In this case the default conversion, described above, is used.
__NOTOC__
__NOTOC__
<!-- imported from file: module_125.html-->
<!-- imported from file: module_125.html-->

Revision as of 20:41, 28 April 2011

Scalar to Boolean Scalar

Scalar to Boolean Scalar

Node Description & Purpose: The Scalar to Boolean scalar node converts a scalar value to a Boolean scalar value. A Boolean has a value of either 1 or 0. There is an optional Threshold value which lets you control how the conversion to a Boolean value happens.

The default conversion, without using a threshold value, is that the Input value is converted to 0 if it equals 0, and it is converted to 1 if it is not equal to 0. As an example:

Input of 0 becomes 0
Input of 0.5 becomes 1
Input of 2 becomes 1
Input of -0.5 becomes 1

Optionally, you can control the conversion to a Boolean by using a threshold value. In this case the Input value is converted to 0 if it is less than the threshold value, and converted to 1 if it is greater than or equal to the threshold value. As an example, using a threshold value of 2 :

Input of 0 becomes 0 ( 0 is less than 2 )
Input of 0.5 becomes 0 ( 0.5 is less than 2 )
Input of 2 becomes 1 ( 2 is greater than or equal to 2 )
Input of 6 becomes 1 ( 6 is greater than or equal to 2 )
Input of -0.5 becomes 0 ( -0.5 is less than 2 )

Node Type: Function

Settings:

  • Use threshold value: If this check box is checked then the supplied threshold value is used to convert the scalar to a Boolean.
  • Threshold value: This is the value that is used for the threshold value, as described above.


Error conditions:

  • It is an error for there to be no Input value. In that case 0 is output from the node.
  • It is an error for there to be no Threshold value shader connected when the Use threshold value check box is checked. In this case the default conversion, described above, is used.