1#ifndef PYMOL_WEBGL_IOS 2#ifdef gl_VertexID_enabled 3#extension GL_EXT_gpu_shader4 : require 4#endif 5#endif 6 7#include webgl_header.vs 8 9attribute vec4 a_Vertex; 10attribute vec3 a_Normal; 11attribute vec4 a_Color; 12attribute float a_interpolate; 13#ifndef gl_VertexID_enabled 14attribute float a_line_position; 15#endif 16 17//#ifdef use_geometry_shaders 18 19#define a_VERTEX gl_Position 20varying vec3 a_NORMAL ; 21varying vec4 a_COLOR ; 22varying vec4 a_COLOR2 ; 23varying vec4 a_COLOR_INTERP ; 24varying float a_INTERPOLATE ; 25varying float a_LINE_POSITION ; 26varying float a_fog; 27#define bgTextureLookup a_bgTextureLookup 28varying vec2 a_bgTextureLookup; 29 30uniform bool isPicking; 31 32void main() 33{ 34#ifdef PYMOL_WEBGL_IOS 35 gl_PointSize = g_PointSize; 36#endif 37 38 vec3 eye_pos = vec3(g_ModelViewMatrix * a_Vertex); 39 a_INTERPOLATE = isPicking ? 0. : a_interpolate; 40#ifdef gl_VertexID_enabled 41 a_LINE_POSITION = mod(float(gl_VertexID), 2.); 42#else 43 a_LINE_POSITION = a_line_position; 44#endif 45 a_VERTEX = g_ProjectionMatrix * g_ModelViewMatrix * a_Vertex; 46 a_NORMAL = normalize(g_NormalMatrix * a_Normal); 47 a_COLOR_INTERP = a_Color; 48 a_COLOR = (1.-a_LINE_POSITION) * a_Color ; 49 a_COLOR2 = a_LINE_POSITION * a_Color; 50 a_fog = (g_Fog_end + eye_pos.z) * g_Fog_scale; 51 a_bgTextureLookup = (gl_Position.xy/gl_Position.w) / 2.0 + 0.5; 52} 53