Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shader system improvements (redo) #2715

Closed
7 changes: 4 additions & 3 deletions src/openfl/display/GraphicsShader.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import openfl.utils.ByteArray;
#end
class GraphicsShader extends Shader
{
@:glVersion("120")
@:glVertexHeader("attribute float openfl_Alpha;
attribute vec4 openfl_ColorMultiplier;
attribute vec4 openfl_ColorOffset;
Expand All @@ -21,7 +22,7 @@ class GraphicsShader extends Shader

uniform mat4 openfl_Matrix;
uniform bool openfl_HasColorTransform;
uniform vec2 openfl_TextureSize;")
uniform vec2 openfl_TextureSize;", true)
@:glVertexBody("openfl_Alphav = openfl_Alpha;
openfl_TextureCoordv = openfl_TextureCoord;

Expand All @@ -47,7 +48,7 @@ class GraphicsShader extends Shader

uniform bool openfl_HasColorTransform;
uniform vec2 openfl_TextureSize;
uniform sampler2D bitmap;")
uniform sampler2D bitmap;", true)
@:glFragmentBody("vec4 color = texture2D (bitmap, openfl_TextureCoordv);

if (color.a == 0.0) {
Expand Down Expand Up @@ -80,7 +81,7 @@ class GraphicsShader extends Shader

gl_FragColor = color * openfl_Alphav;

}")
}", true)
#if emscripten
@:glFragmentSource("#pragma header

Expand Down
Loading
Loading