change shader version to 100 for android support

This commit is contained in:
Nikola Petrov
2024-08-15 18:57:22 +02:00
parent bd31e1058d
commit f58fabcea9
3 changed files with 58 additions and 22 deletions

36
shaders/sun_100.fs Normal file
View File

@@ -0,0 +1,36 @@
#version 100
precision mediump float;
varying vec2 fragTexCoord;
varying vec4 fragColor;
uniform vec3 color;
uniform float sun_radius;
uniform float start_transperency;
vec2 offset = vec2(1.0, 1.0);
float sun_end = 1.0;
void main()
{
offset.x -= fragTexCoord.x * 2.0;
offset.y -= fragTexCoord.y * 2.0;
float radius = length(offset);
if(radius < sun_radius){
gl_FragColor = vec4(color, 1.0);
}else if(radius < sun_end){
float gradient = radius;
gradient -= sun_radius;
gradient = gradient / (sun_end - sun_radius) * start_transperency;
gl_FragColor = vec4(color, start_transperency - gradient);
}else{
gl_FragColor = vec4(color, 0.0);
}
}