Type:ColorMask: Difference between revisions

From Resonite Wiki
Added ColorMask type
 
m Bold faced enum values
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
It can take on the following possible values
It can take on the following possible values


* RGBA - (Default) All color channels are affected
* '''RGBA''' - (Default) All color channels are affected
* None - No color channels are affected
* '''None''' - No color channels are affected
* A - Only Alpha is affected
* '''A''' - Only Alpha is affected
* B - Only the Blue channel is affected
* '''B''' - Only the Blue channel is affected
* G - Only the Green channel is affected
* '''G''' - Only the Green channel is affected
* R - Only the Red channel is affected
* '''R''' - Only the Red channel is affected
* RGB - All color channels are affected, but Alpha is excluded
* '''RGB''' - All color channels are affected, but Alpha is excluded


== Usage ==
== Usage ==
Most of the time the RGBA mode will be used, however another common use for the ColorMask is to exclude color information entirely for [[Stencil]] effects.
Most of the time the '''RGBA''' mode will be used, however another common use for the ColorMask is to exclude color information entirely for [[Stencil]] effects.


For a material writing to the stencil buffer, the ColorMask would usually be set to None which ensures that only the stencil value is modified, the effect of which is that this material becomes completely invisible, whereas usually the material reading the stencil buffer will also write to some color channel so that it has a visual effect in area that is desired.
For a material writing to the stencil buffer, the ColorMask would usually be set to '''None''' which ensures that only the stencil value is modified, the effect of which is that this material becomes completely invisible, whereas usually the material reading the stencil buffer will also write to some color channel so that it has a visual effect in area that is desired.
 
 
[[Category:Enums]]
[[Category:Type]]

Latest revision as of 21:14, 15 January 2024

A ColorMask is an Enum which describes which color channels should be affected by a particular material. This is present in many materials and allows for a material to only affect a specific R/G/B/A channel, or to allow a material to have no effect on color at all such as for depth or stencil buffer effects.

It can take on the following possible values

  • RGBA - (Default) All color channels are affected
  • None - No color channels are affected
  • A - Only Alpha is affected
  • B - Only the Blue channel is affected
  • G - Only the Green channel is affected
  • R - Only the Red channel is affected
  • RGB - All color channels are affected, but Alpha is excluded

Usage

Most of the time the RGBA mode will be used, however another common use for the ColorMask is to exclude color information entirely for Stencil effects.

For a material writing to the stencil buffer, the ColorMask would usually be set to None which ensures that only the stencil value is modified, the effect of which is that this material becomes completely invisible, whereas usually the material reading the stencil buffer will also write to some color channel so that it has a visual effect in area that is desired.