Unity Products:Amplify Shader Editor/Global Array and Unity Products:Amplify Shader Editor/HSV to RGB: Difference between pages

From Amplify Creations Wiki
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
ampwiki>Amplify RnD Rick
No edit summary
 
Line 1: Line 1:
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]


== Global Array Node ==
== HSV to RGB Node ==


The Global Array node creates and accesses a global array. Array's type, size and name can be configured via its [[#paramType|Type]], [[#paramArrayLength|Array Length]] and [[#paramName|Name]] respective options.
The HSV to RGB node converts a value from an HSV to a RGB color space.
RGB color space is defined by three separate channels:
* '''R:''' First channel defines the amount of red in the color
* '''G:''' Second channel defines the amount of green in the color
* '''B:''' Third channel defines the amount of blue in the color


<img class="responsive-img" src="http://wiki.amplify.pt/images/Nodes/GlobalArray.jpg">
As for the HSV color space, it represents color in a cylinder and also contains three separate channels but each one as a completely different meaning
* '''Hue:''' First channel defines the color itself as an angle on a color cylinder 
* '''Saturation:''' Second channel defines amount of gray in the color as a distance across a color cylinder radius
* '''Value:''' Third channel defines brightness/intensity of the color as a distance across a color cylinder height
 
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/HSVtoRGBNode.jpg">
<br/><font size="1">Nodes used:
[[Unity_Products:Amplify_Shader_Editor/World_Position|World Position]],
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],
[[Unity_Products:Amplify_Shader_Editor/HSV_to_RGB|HSV to RGB]]
</font>


{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
|-
|-
! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value
! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value
|-
|- style="background: #e5e5e5;"
| id="paramMode" | Mode
| id="paramHue" | Hue
| Defines if the current creates the array or reference an already created array over other node.
| Color itself, represents an angle on the HSV cylindrical model.
* '''Object:''' Create and access a global array with the specified setup
Only visible if the respective input port is not connected.
* '''Reference:''' Access a global array created on another node
| Object
|-
|- style="background: #e5e5e5;" |
| id="paramReference" | Reference
| Global Array node which creates the global array we want to use.
| <None>
|-
| id="paramName" | Name
| Name of the global array to be created/accessed.
| MyGlobalArray
|-
| id="paramAutoRegisterMode" | Auto-Register
| If toggled on, creates the property and/or global variable even if not connected to an Output node
| Off
|-
| id="paramIsJagged" | Is Jagged
| If toggled on, creates a multi-dimensional array/array of arrays.
| Off
|-
|- style="background: #e5e5e5;" |
| id="paramIndex" | Index
| Position on the array to be accessed. Only visible if the respective input port is not connected.
| 0
| 0
|-
|- style="background: #e5e5e5;"
|- style="background: #e5e5e5;" |
| id="paramSaturation" | Saturation
|id="paramArrayLength" | ArrayLength 
| Amount of gray in the color, represents a distance across the HSV cylindrical model radius.
| Length of the array to be created. Only visible if the respective input port is not connected.
Only visible if the respective input port is not connected.
| 1
|-
|- style="background: #e5e5e5;" |
| id="paramIndexX" | Index X
| Position on the first index to be accessed, only shown on jagged array. Only visible if the respective input port is not connected.
| 0
| 0
|-
|- style="background: #e5e5e5;"
|- style="background: #e5e5e5;" |
| id="paramValue" | Value
| id="paramIndexY" | Index Y
| Brightness/Intensity of the color, represents a distance across the HSV cylindrical model height.
| Position on the second index to be accessed, only shown on jagged array. Only visible if the respective input port is not connected.
Only visible if the respective input port is not connected.
| 0
| 0
|-
|-
|- style="background: #e5e5e5;" |
| id="paramprecision" | Precision
| id="paramLengthX" | Array Length X
| Defines the amount of bytes the variable can hold, effectively defining how precise the value is. It's usefulness is bond by the hardware specifications necessary. Lowest precision is slightly faster but might produce errors and artifacts.
| Length, dimension of the first array to be created, only shown on jagged array. Only visible if the respective input port is not connected.
* '''Float:''' Highest precision, useful for values that can be very high or very low in value (ie: positions, coordinates, etc)
| 1
* '''Half:''' Medium precision, in most cases is as good as '''Float''' but at half of it's precision
|-
*'''Inherit:''' Use global precision set on master node properties
|- style="background: #e5e5e5;" |
| id="paramLengthY" | Array Length Y
| Length, dimension of the second array (array of the array) to be created, only shown on jagged array. Only visible if the respective input port is not connected.
| 1
|-
|id="paramType" | Type
| Type of data the array will contain.
*'''Float:''' Float data type
*'''Color:'''   Float4 data type
*'''Vector4:''' Float4 data type
*'''Matrix4x4:''' Float4x4 data type
| Float
| Float
|-
|-
|id="paramRange" | Range Check
| if toggled on, adds additional clamp instruction to prevent out of bounds access to the array.
| False
|}
|}


Line 81: Line 53:
|-  
|-  
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
|-
| Hue
| Color itself, represents an angle on the HSV cylindrical model.
| Float
|-  
|-  
| Index
| Saturation
|Position on the array to be accessed.  
| Amount of gray in the color, represents a distance across the HSV cylindrical model radius.
| Int
| Float
|-
| Value
| Brightness/Intensity of the color, represents a distance across the HSV cylindrical model height.
| Float
|}
 
 
{| class="wikitable" style="width: 100%;"
|-  
|-  
| Array Length
! style="width: 10%;" | Output Port !! Description !! style="width: 10%;" | Type
| Length of the array to be created.
| Int
|-  
|-  
| Index X
| RGB
|Position on the first index to be accessed, only shown on jagged array.
| Returns the converted value in RGB color space.
| Int
| Float3
|-  
|-  
| Index Y
| R
|Position on the second index to be accessed, only shown on jagged array.
| Returns only the Red component of the converted value in RGB color space.
| Int
| Float
|-  
|-  
| Array Length X
| G
|Length, dimension of the first array to be created, only shown on jagged array.  
| Returns only the Green component of the converted value in RGB color space.
| Int
| Float
|-  
|-  
| Array Length Y
| B
|Length, dimension of the second array (array of the array) to be created, only shown on jagged array.  
| Returns only the Blue component of the converted value in RGB color space.
| Int
| Float
|}
|}


[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Category:Nodes]][[Category:Constants And Properties]]
[[Category:Nodes]][[Category:Image Effects]]

Revision as of 11:51, 26 August 2021

Back to Node List

HSV to RGB Node

The HSV to RGB node converts a value from an HSV to a RGB color space. RGB color space is defined by three separate channels:

  • R: First channel defines the amount of red in the color
  • G: Second channel defines the amount of green in the color
  • B: Third channel defines the amount of blue in the color

As for the HSV color space, it represents color in a cylinder and also contains three separate channels but each one as a completely different meaning

  • Hue: First channel defines the color itself as an angle on a color cylinder
  • Saturation: Second channel defines amount of gray in the color as a distance across a color cylinder radius
  • Value: Third channel defines brightness/intensity of the color as a distance across a color cylinder height


Nodes used: World Position, Float, HSV to RGB

Node Parameter Description Default Value
Hue Color itself, represents an angle on the HSV cylindrical model.

Only visible if the respective input port is not connected.

0
Saturation Amount of gray in the color, represents a distance across the HSV cylindrical model radius.

Only visible if the respective input port is not connected.

0
Value Brightness/Intensity of the color, represents a distance across the HSV cylindrical model height.

Only visible if the respective input port is not connected.

0
Precision Defines the amount of bytes the variable can hold, effectively defining how precise the value is. It's usefulness is bond by the hardware specifications necessary. Lowest precision is slightly faster but might produce errors and artifacts.
  • Float: Highest precision, useful for values that can be very high or very low in value (ie: positions, coordinates, etc)
  • Half: Medium precision, in most cases is as good as Float but at half of it's precision
  • Inherit: Use global precision set on master node properties
Float


Input Port Description Type
Hue Color itself, represents an angle on the HSV cylindrical model. Float
Saturation Amount of gray in the color, represents a distance across the HSV cylindrical model radius. Float
Value Brightness/Intensity of the color, represents a distance across the HSV cylindrical model height. Float


Output Port Description Type
RGB Returns the converted value in RGB color space. Float3
R Returns only the Red component of the converted value in RGB color space. Float
G Returns only the Green component of the converted value in RGB color space. Float
B Returns only the Blue component of the converted value in RGB color space. Float

Back to Node List