mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Linux/AMD: Fixed font shaders.
This commit is contained in:
parent
a9025c8e07
commit
9c005e40ba
2 changed files with 15 additions and 7 deletions
|
@ -8,6 +8,11 @@ void main()
|
||||||
{
|
{
|
||||||
vec4 color = textureCube(u_texColor, v_texcoord0.xyz);
|
vec4 color = textureCube(u_texColor, v_texcoord0.xyz);
|
||||||
int index = int(v_texcoord0.w*4.0 + 0.5);
|
int index = int(v_texcoord0.w*4.0 + 0.5);
|
||||||
float a = color.bgra[index];
|
float rgba[4];
|
||||||
gl_FragColor = vec4(v_color0.rgb, v_color0.a * a);
|
rgba[0] = color.z;
|
||||||
|
rgba[1] = color.y;
|
||||||
|
rgba[2] = color.x;
|
||||||
|
rgba[3] = color.w;
|
||||||
|
float alpha = rgba[index];
|
||||||
|
gl_FragColor = vec4(v_color0.xyz, v_color0.a * alpha);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,21 @@ $input v_color0, v_texcoord0
|
||||||
|
|
||||||
SAMPLERCUBE(u_texColor, 0);
|
SAMPLERCUBE(u_texColor, 0);
|
||||||
|
|
||||||
uniform float u_inverse_gamma;
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 color = textureCube(u_texColor, v_texcoord0.xyz);
|
vec4 color = textureCube(u_texColor, v_texcoord0.xyz);
|
||||||
int index = int(v_texcoord0.w*4.0 + 0.5);
|
int index = int(v_texcoord0.w*4.0 + 0.5);
|
||||||
float distance = color.bgra[index];
|
float rgba[4];
|
||||||
|
rgba[0] = color.z;
|
||||||
|
rgba[1] = color.y;
|
||||||
|
rgba[2] = color.x;
|
||||||
|
rgba[3] = color.w;
|
||||||
|
float dist = rgba[index];
|
||||||
|
|
||||||
float dx = length(dFdx(v_texcoord0.xyz) );
|
float dx = length(dFdx(v_texcoord0.xyz) );
|
||||||
float dy = length(dFdy(v_texcoord0.xyz) );
|
float dy = length(dFdy(v_texcoord0.xyz) );
|
||||||
float w = 16.0*0.5*(dx+dy);
|
float w = 16.0*0.5*(dx+dy);
|
||||||
|
|
||||||
float a = smoothstep(0.5-w, 0.5+w, distance);
|
float alpha = smoothstep(0.5-w, 0.5+w, dist);
|
||||||
gl_FragColor = vec4(v_color0.rgb, v_color0.a*a);
|
gl_FragColor = vec4(v_color0.xyz, v_color0.w*alpha);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue