Merge branch 'main' into base-fnf-port-remake
This commit is contained in:
@@ -483,22 +483,22 @@ uniform bool hasTransform;
|
||||
uniform bool hasColorTransform;
|
||||
|
||||
vec4 applyFlixelEffects(vec4 color) {
|
||||
if (!hasTransform) {
|
||||
if(!hasTransform) {
|
||||
return color;
|
||||
}
|
||||
|
||||
if (color.a == 0.0) {
|
||||
if(color.a == 0.0) {
|
||||
return vec4(0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
if (!hasColorTransform) {
|
||||
if(!hasColorTransform) {
|
||||
return color * openfl_Alphav;
|
||||
}
|
||||
|
||||
color.rgb = color.rgb / color.a;
|
||||
color = clamp(openfl_ColorOffsetv + (color * openfl_ColorMultiplierv), 0.0, 1.0);
|
||||
|
||||
if (color.a > 0.0) {
|
||||
if(color.a > 0.0) {
|
||||
return vec4(color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);
|
||||
}
|
||||
return vec4(0.0, 0.0, 0.0, 0.0);
|
||||
@@ -541,39 +541,37 @@ varying vec2 openfl_TextureCoordv;
|
||||
|
||||
uniform mat4 openfl_Matrix;
|
||||
uniform bool openfl_HasColorTransform;
|
||||
uniform vec2 openfl_TextureSize;";
|
||||
uniform vec2 openfl_TextureSize;
|
||||
|
||||
attribute float alpha;
|
||||
attribute vec4 colorMultiplier;
|
||||
attribute vec4 colorOffset;
|
||||
uniform bool hasColorTransform;";
|
||||
|
||||
public static final vertBody:String = "openfl_Alphav = openfl_Alpha;
|
||||
openfl_TextureCoordv = openfl_TextureCoord;
|
||||
|
||||
if (openfl_HasColorTransform) {
|
||||
if(openfl_HasColorTransform) {
|
||||
openfl_ColorMultiplierv = openfl_ColorMultiplier;
|
||||
openfl_ColorOffsetv = openfl_ColorOffset / 255.0;
|
||||
}
|
||||
|
||||
openfl_Alphav = openfl_Alpha * alpha;
|
||||
|
||||
if(hasColorTransform) {
|
||||
openfl_ColorOffsetv = colorOffset / 255.0;
|
||||
openfl_ColorMultiplierv = colorMultiplier;
|
||||
}
|
||||
|
||||
gl_Position = openfl_Matrix * openfl_Position;";
|
||||
|
||||
|
||||
public static final defaultVertexSource:String = "#pragma header
|
||||
|
||||
attribute float alpha;
|
||||
attribute vec4 colorMultiplier;
|
||||
attribute vec4 colorOffset;
|
||||
uniform bool hasColorTransform;
|
||||
|
||||
void main(void) {
|
||||
#pragma body
|
||||
|
||||
openfl_Alphav = openfl_Alpha * alpha;
|
||||
|
||||
if (hasColorTransform) {
|
||||
openfl_ColorOffsetv = colorOffset / 255.0;
|
||||
openfl_ColorMultiplierv = colorMultiplier;
|
||||
}
|
||||
}";
|
||||
|
||||
|
||||
// TODO: camera stuff
|
||||
public static final defaultFragmentSource:String = "#pragma header
|
||||
|
||||
void main(void) {
|
||||
|
||||
Reference in New Issue
Block a user