adding special text
parent
5b1398b3f4
commit
afdcaf654d
|
@ -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 = ",";
|
||||
|
|
|
@ -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.
Binary file not shown.
|
@ -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.
Loading…
Reference in New Issue