23 lines
694 B
GLSL
23 lines
694 B
GLSL
#version 100
|
|
|
|
// GLES port of engine/shaders/star.frag - identical logic, plus an
|
|
// explicit precision declaration (required in GLES). gl_PointCoord and
|
|
// point-sprite rasterization for GL_POINTS both work automatically in
|
|
// GLES with no separate enable call (unlike desktop's GL_POINT_SPRITE,
|
|
// which doesn't exist in GLES at all - see
|
|
// android/engine-patches/03-android-opengl-es-render.patch's
|
|
// init_opengl() change).
|
|
precision mediump float;
|
|
|
|
varying float Light;
|
|
|
|
void main() {
|
|
vec2 mid = vec2(0.5, 0.5) - gl_PointCoord;
|
|
|
|
float dist = 0.5 - length(mid);
|
|
dist *= 3.0;
|
|
dist = min(dist, 1.0);
|
|
|
|
gl_FragColor = vec4(dist * Light, dist * Light, dist * Light, 1.0);
|
|
}
|