#include "sun_vert.h" const char* shader_sun_vert = " \n" "attribute vec2 position; \n" "attribute vec4 color; \n" "attribute mat4 vMatrix; \n" "uniform mat4 projection; \n" "uniform mat4 model; \n" "varying lowp vec4 VertexColor; \n" "varying lowp vec2 TexCoord; \n" " \n" "void main() { \n" " vec4 fragmentPosition = projection * model * vMatrix * vec4(position.x, position.y, 0, 1); \n" " gl_Position = fragmentPosition; \n" " VertexColor = color; \n" " // Normalize the position - the center is at (0,0) and edge vertices are at distance 'radius' \n" " // We want TexCoord to be in the range roughly [-1, 1] at the edges \n" " lowp float maxDist = length(position); \n" " if (maxDist > 0.1) { \n" " TexCoord = position / maxDist; \n" " } else { \n" " TexCoord = vec2(0.0, 0.0); \n" " } \n" "} \n" " \n";