Constructor

@:glFragmentSource("\n #pragma header\n\n // uniform float alphaShit;\n uniform float xPos;\n uniform float yPos;\n\n uniform int numoutlines = 1;\n\n vec3 rgb2hsv(vec3 c)\n {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }\n\n void main()\n {\n vec4 color = flixel_texture2D(bitmap, openfl_TextureCoordv);\n vec2 size = vec2(xPos, yPos);\n\n if (color.a == 0.0) {\n float w = size.x / openfl_TextureSize.x;\n float h = size.y / openfl_TextureSize.y;\n\n vec4 colorOffset = flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y - h));\n\n\n vec3 hsvShit = rgb2hsv(vec3(colorOffset.r, colorOffset.g, colorOffset.b));\n\n if (hsvShit.b <= 0.1 && colorOffset.a != 0.)\n color = vec4(0.0, 1.0, 0.8, color.a);\n }\n\n gl_FragColor = color;\n }\n\n ")new()

Variables

@:keepalphaShit:ShaderParameter_Float

@:value(0)funnyX:Float = 0

@:value(0)funnyY:Float = 0

@:keepnumoutlines:ShaderParameter_Int

@:keepxPos:ShaderParameter_Float

@:keepyPos:ShaderParameter_Float

Inherited Variables

Defined by FlxGraphicsShader

@:keepalpha:ShaderParameter_Float

@:keepcolorMultiplier:ShaderParameter_Float

@:keepcolorOffset:ShaderParameter_Float

@:keephasColorTransform:ShaderParameter_Bool

@:keephasTransform:ShaderParameter_Bool

@:keeppremultiplyAlpha:ShaderParameter_Bool

Defined by GraphicsShader

@:keepbitmap:ShaderInput_openfl_display_BitmapData

Defined by Shader

write onlybyteCode:ByteArray

The raw shader bytecode for this Shader instance.

data:ShaderData

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.

read onlyglFragmentBodyRaw:String

The default GLSL vertex body, before being applied to the vertex source.

glFragmentExtensions:Array<{name:String, behavior:String}>

read onlyglFragmentHeaderRaw:String

The default GLSL vertex header, before being applied to the vertex source.

glFragmentSource:String

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

This property is not available on the Flash target.

read onlyglFragmentSourceRaw:String

The default GLSL fragment source, before #pragma values are replaced.

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

The compiled GLProgram if available.

This property is not available on the Flash target.

glVersion:String

Get or set the GLSL version used in the header when compiling with GLSL.

  • 120 is required for initialization (i.e. providing a default value for) uniform variables

read onlyglVertexBodyRaw:String

The default GLSL vertex body, before being applied to the vertex source.

glVertexExtensions:Array<{name:String, behavior:String}>

Provides additional #extension directives to insert in the vertex and fragment shaders.

Example:

@:glExtensions([{name: "OES_standard_derivatives", behavior: "require"}])
@:glVertexExtensions([{name: "OES_standard_derivatives", behavior: "require"}])
@:glFragmentExtensions([{name: "OES_standard_derivatives", behavior: "require"}])

read onlyglVertexHeaderRaw:String

The default GLSL vertex header, before being applied to the vertex source.

glVertexSource:String

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

This property is not available on the Flash target.

read onlyglVertexSourceRaw:String

The default GLSL vertex source, before #pragma values are replaced.

precisionHint:ShaderPrecision

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)

program:Program3D

The compiled Program3D if available.

This property is not available on the Flash target.

Inherited Methods