API Documentation
class
CheckerShader
package
cherry.plugins.generic.shaders
extends
Shader
@:src({ @param var checkerSize:Float = 8; @param var blackColor:Vec4; @param var whiteColor:Vec4; var pixelColor:Vec4; @var var calculatedUV:Vec2; function fragment() { var tvec = calculatedUV / checkerSize; var black = (tvec.x % 2) < 1; if ((tvec.y % 2) < 1) black = !black; if (black) { pixelColor.rgb = blackColor.rgb; pixelColor.a *= blackColor.a; } else { pixelColor.rgb = whiteColor.rgb; pixelColor.a *= whiteColor.a; }; }; })
@:build(hxsl.Macros.buildShader())
@:autoBuild(hxsl.Macros.buildShader())
Constructor
new
(
?white:
Vector
,
?black:
Vector
)
Variables
blackColor
:
Vec
checkerSize
:
Float
whiteColor
:
Vec
Methods