adding special text

pull/1/head
BuildTools 2019-05-26 19:45:25 +10:00
parent 5b1398b3f4
commit afdcaf654d
6 changed files with 41 additions and 3 deletions

View File

@ -20,7 +20,7 @@ public class MetaFile {
private static final int PAD_BOTTOM = 2;
private static final int PAD_RIGHT = 3;
private static final int DESIRED_PADDING = 3;
private static final int DESIRED_PADDING = 8;
private static final String SPLITTER = " ";
private static final String NUMBER_SEPARATOR = ",";

View File

@ -7,8 +7,27 @@ out vec4 out_colour;
uniform vec3 colour;
uniform sampler2D fontAtlas;
const float width = 0.5;
const float edge = 0.1;
uniform float borderWidth = 0.0;
uniform float borderEdge = 0.1;
uniform vec2 offset = vec2(0.0, 0.0);
uniform vec3 outlineColour = vec3(1.0,0.0,0.0);
void main(void){
out_colour = vec4(colour, texture(fontAtlas, pass_textureCoords).a);
float distance = 1.0 - texture(fontAtlas, pass_textureCoords).a;
float alpha = 1.0 - smoothstep(width, width + edge, distance);
float distance2 = 1.0 - texture(fontAtlas, pass_textureCoords + offset).a;
float outlineAlpha = 1.0 - smoothstep(borderWidth, borderWidth + borderEdge, distance2);
float overallAlpha = alpha + (1.0 - alpha) * outlineAlpha;
vec3 overallColour = mix(outlineColour, colour, alpha / overallAlpha);
out_colour = vec4(overallColour, overallAlpha);
}

View File

@ -7,8 +7,27 @@ out vec4 out_colour;
uniform vec3 colour;
uniform sampler2D fontAtlas;
const float width = 0.5;
const float edge = 0.1;
uniform float borderWidth = 0.0;
uniform float borderEdge = 0.1;
uniform vec2 offset = vec2(0.0, 0.0);
uniform vec3 outlineColour = vec3(1.0,0.0,0.0);
void main(void){
out_colour = vec4(colour, texture(fontAtlas, pass_textureCoords).a);
float distance = 1.0 - texture(fontAtlas, pass_textureCoords).a;
float alpha = 1.0 - smoothstep(width, width + edge, distance);
float distance2 = 1.0 - texture(fontAtlas, pass_textureCoords + offset).a;
float outlineAlpha = 1.0 - smoothstep(borderWidth, borderWidth + borderEdge, distance2);
float overallAlpha = alpha + (1.0 - alpha) * outlineAlpha;
vec3 overallColour = mix(outlineColour, colour, alpha / overallAlpha);
out_colour = vec4(overallColour, overallAlpha);
}

Binary file not shown.