summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders/canvas.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/shaders/canvas.glsl')
-rw-r--r--drivers/gles3/shaders/canvas.glsl28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl
index 41d308b776..381a0e8a73 100644
--- a/drivers/gles3/shaders/canvas.glsl
+++ b/drivers/gles3/shaders/canvas.glsl
@@ -21,6 +21,15 @@ layout(location = 10) in uvec4 bone_attrib;
layout(location = 11) in vec4 weight_attrib;
#endif
+
+// This needs to be outside clang-format so the ubo comment is in the right place
+#ifdef MATERIAL_UNIFORMS_USED
+layout(std140) uniform MaterialUniforms{ //ubo:4
+
+#MATERIAL_UNIFORMS
+
+};
+#endif
/* clang-format on */
#include "canvas_uniforms_inc.glsl"
#include "stdlib_inc.glsl"
@@ -38,15 +47,6 @@ out vec2 pixel_size_interp;
#endif
-#ifdef MATERIAL_UNIFORMS_USED
-layout(std140) uniform MaterialUniforms{
-//ubo:4
-
-#MATERIAL_UNIFORMS
-
-};
-#endif
-
#GLOBALS
void main() {
@@ -518,8 +518,8 @@ void main() {
float px_size = max(0.5 * dot((vec2(px_range) / msdf_size), dest_size), 1.0);
float d = msdf_median(msdf_sample.r, msdf_sample.g, msdf_sample.b, msdf_sample.a) - 0.5;
- if (outline_thickness > 0) {
- float cr = clamp(outline_thickness, 0.0, px_range / 2) / px_range;
+ if (outline_thickness > 0.0) {
+ float cr = clamp(outline_thickness, 0.0, px_range / 2.0) / px_range;
float a = clamp((d + cr) * px_size, 0.0, 1.0);
color.a = a * color.a;
} else {
@@ -710,8 +710,8 @@ void main() {
vec2 pos_rot = pos_norm * mat2(vec2(0.7071067811865476, -0.7071067811865476), vec2(0.7071067811865476, 0.7071067811865476)); //is there a faster way to 45 degrees rot?
float tex_ofs;
float distance;
- if (pos_rot.y > 0) {
- if (pos_rot.x > 0) {
+ if (pos_rot.y > 0.0) {
+ if (pos_rot.x > 0.0) {
tex_ofs = pos_box.y * 0.125 + 0.125;
distance = shadow_pos.x;
} else {
@@ -719,7 +719,7 @@ void main() {
distance = shadow_pos.y;
}
} else {
- if (pos_rot.x < 0) {
+ if (pos_rot.x < 0.0) {
tex_ofs = pos_box.y * -0.125 + (0.5 + 0.125);
distance = -shadow_pos.x;
} else {