@:value({ code : null })@:glVertexHeader("attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform vec2 openfl_TextureSize;")@:glVertexBody("openfl_TextureCoordv = openfl_TextureCoord;\n\n\t\tgl_Position = openfl_Matrix * openfl_Position;")@:glVertexSource("#pragma header\n\n\t\tvoid main(void) {\n\n\t\t\t#pragma body\n\n\t\t}")@:glFragmentHeader("varying vec2 openfl_TextureCoordv;\n\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform vec2 openfl_TextureSize;")@:glFragmentBody("gl_FragColor = texture2D (openfl_Texture, openfl_TextureCoordv);")@:glFragmentSource("#pragma header\n\n\t\tvoid main(void) {\n\n\t\t\t#pragma body\n\n\t\t}")new(?code:ByteArray)

Inherited Variables

Defined by Shader

write onlybyteCode:ByteArray

The raw shader bytecode for this Shader instance.


Provides access to parameters, input images, and metadata for the Shader instance. ShaderParameter objects representing parameters for the shader, ShaderInput objects representing the input images for the shader, and other values representing the shader's metadata are dynamically added as properties of the data property object when the Shader instance is created. Those properties can be used to introspect the shader and to set parameter and input values. For information about accessing and manipulating the dynamic properties of the data object, see the ShaderData class description.


Get or set the fragment source used when compiling with GLSL.

This property is not available on the Flash target.

@SuppressWarnings("checkstyle:Dynamic")read onlyglProgram:GLProgram

The compiled GLProgram if available.

This property is not available on the Flash target.


Get or set the vertex source used when compiling with GLSL.

This property is not available on the Flash target.


The precision of math operations performed by the shader. The set of possible values for the precisionHint property is defined by the constants in the ShaderPrecision class.

The default value is ShaderPrecision.FULL. Setting the precision to ShaderPrecision.FAST can speed up math operations at the expense of precision.

Full precision mode (ShaderPrecision.FULL) computes all math operations to the full width of the IEEE 32-bit floating standard and provides consistent behavior on all platforms. In this mode, some math operations such as trigonometric and exponential functions can be slow.

Fast precision mode (ShaderPrecision.FAST) is designed for maximum performance but does not work consistently on different platforms and individual CPU configurations. In many cases, this level of precision is sufficient to create graphic effects without visible artifacts.

The precision mode selection affects the following shader operations. These operations are faster on an Intel processor with the SSE instruction set:

  • sin(x)
  • cos(x)
  • tan(x)
  • asin(x)
  • acos(x)
  • atan(x)
  • atan(x, y)
  • exp(x)
  • exp2(x)
  • log(x)
  • log2(x)
  • pow(x, y)
  • reciprocal(x)
  • sqrt(x)


The compiled Program3D if available.

This property is not available on the Flash target.

Inherited Methods