Improve compatibility with GLES back-end
This commit is contained in:
@@ -42,31 +42,31 @@ void main() {
|
||||
if (mask == 1) {
|
||||
offset.x = 1.0 - (threshold-t10) / zd(t00-t10);
|
||||
offset.y = 1.0 - ((threshold-t01) / zd(t00-t01));
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 2) {
|
||||
offset.x = ((threshold-t00) / zd(t10-t00));
|
||||
offset.y = 1.0-(threshold-t11) / zd(t10-t11);
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 3) { // OK
|
||||
float dy0 = 1.0 - (threshold - t01) / zd(t00 - t01);
|
||||
float dy1 = 1.0 - (threshold - t11) / zd(t10 - t11);
|
||||
offset.y = dy0 + dy1;
|
||||
offset.x = 1.0;
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 4) { // OK
|
||||
offset.x = 1.0 - (threshold-t11) / zd(t01-t11);
|
||||
offset.y = (threshold-t00) / zd(t01-t00);
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 5) { // OK
|
||||
float dx0 = 1.0- (threshold - t10) / zd(t00 - t10);
|
||||
float dx1 = 1.0-(threshold - t11) / zd(t01 - t11);
|
||||
offset.x = dx0 + dx1;
|
||||
offset.y = 1.0;
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 6 || mask == 9) {
|
||||
offset = vec2(0.5);
|
||||
@@ -74,41 +74,41 @@ void main() {
|
||||
if (mask == 7) { // OK
|
||||
offset.x = 1.0 - (threshold-t11) / zd(t01-t11);
|
||||
offset.y = 1.0 - (threshold-t11) / zd(t10-t11);
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 8) { // OK
|
||||
offset.x = (threshold-t01) / zd(t11-t01);
|
||||
offset.y = (threshold-t10) / zd(t11-t10);
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 10) { // OK
|
||||
float dx0 = (threshold - t00) / zd(t10 - t00);
|
||||
float dx1 = (threshold - t01) / zd(t11 - t01);
|
||||
offset.x = (dx0 + dx1);
|
||||
offset.y = 1.0;
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 11) { // OK
|
||||
offset.x = (threshold-t01) / zd(t11-t01);
|
||||
offset.y = (threshold-t01) / zd(t00-t01);
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 12) { // OK
|
||||
float dy0 = (threshold - t00) / zd(t01 - t00);
|
||||
float dy1 = (threshold - t10) / zd(t11 - t10);
|
||||
offset.y = dy0 + dy1;
|
||||
offset.x = 1.0;
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 13) { // OK
|
||||
offset.x = 1.0 - (threshold-t10) / zd(t00-t10);
|
||||
offset.y = (threshold-t10) / zd(t11-t10);
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
if (mask == 14) { // OK
|
||||
offset.x = (threshold-t00) / zd(t10-t00);
|
||||
offset.y = (threshold-t00) / zd(t01-t00);
|
||||
offset /= 2;
|
||||
offset /= 2.0;
|
||||
}
|
||||
|
||||
float contour = (mask != 0 && mask != 15)?1.0:0.0;
|
||||
|
||||
@@ -51,9 +51,9 @@ void main() {
|
||||
}
|
||||
#else
|
||||
if (!normalizedDistance) {
|
||||
o_color = vec4( length(pixelDistance * distanceScale).xx, outputData, 1.0);
|
||||
o_color = vec4( vec2(length(pixelDistance * distanceScale)), outputData, 1.0);
|
||||
} else if (!unitDirection) {
|
||||
o_color = vec4( length(pixelDistance / originalSize).xx, outputData, 1.0);
|
||||
o_color = vec4( vec2(length(pixelDistance / originalSize)), outputData, 1.0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -39,7 +39,7 @@ void main() {
|
||||
fc += backgroundColor * backgroundColor.a;
|
||||
}
|
||||
|
||||
if ((d0 < angleTreshold || d1 < angleTreshold || d2 < angleTreshold || d3 < angleTreshold) && ct.z > 0.0 && length(ct.xy) > 4) {
|
||||
if ((d0 < angleTreshold || d1 < angleTreshold || d2 < angleTreshold || d3 < angleTreshold) && ct.z > 0.0 && length(ct.xy) > 4.0) {
|
||||
fc = fc * (1.0 - skeletonColor.a) + (skeletonColor * skeletonColor.a);
|
||||
}
|
||||
o_color = fc;
|
||||
|
||||
Reference in New Issue
Block a user