@@ -243,20 +243,20 @@ def loadShaders2(self):
243243 if not self .shaderProgramOff :
244244 return False
245245
246- aK = ("#version 330 core \n "
247- "layout(location = 0) in vec2 a_position;"
248- "layout(location = 1) in vec2 a_texCoord;"
249- "out vec2 v_texCoord;"
250- "out vec4 v_clipPos;"
246+ aK = ("#version 120 \n "
247+ "attribute vec2 a_position;"
248+ "attribute vec2 a_texCoord;"
249+ "varying vec2 v_texCoord;"
250+ "varying vec4 v_clipPos;"
251251 "uniform mat4 u_mvpMatrix;"
252252 "void main(){"
253253 " gl_Position = u_mvpMatrix * vec4(a_position, 0.0, 1.0);"
254254 " v_clipPos = gl_Position;"
255255 " v_texCoord = a_texCoord;"
256256 " v_texCoord.y = 1.0 - v_texCoord.y;}" )
257- aM = ("#version 330 core \n "
258- "in vec2 v_texCoord;"
259- "in vec4 v_clipPos;"
257+ aM = ("#version 120 \n "
258+ "varying vec2 v_texCoord;"
259+ "varying vec4 v_clipPos;"
260260 "uniform sampler2D s_texture0;"
261261 "uniform vec4 u_channelFlag;"
262262 "uniform vec4 u_baseColor;"
@@ -271,20 +271,20 @@ def loadShaders2(self):
271271 " * step(u_baseColor.y, v_clipPos.y/v_clipPos.w)"
272272 " * step(v_clipPos.x/v_clipPos.w, u_baseColor.z)"
273273 " * step(v_clipPos.y/v_clipPos.w, u_baseColor.w);"
274- " smpColor = u_channelFlag * texture (s_texture0, v_texCoord).a * isInside;"
274+ " smpColor = u_channelFlag * texture2D (s_texture0, v_texCoord).a * isInside;"
275275 " }else{"
276- " smpColor = texture (s_texture0 , v_texCoord);"
276+ " smpColor = texture2D (s_texture0 , v_texCoord);"
277277 " smpColor.rgb = smpColor.rgb * u_multiplyColor.rgb;"
278278 " smpColor.rgb = smpColor.rgb + u_screenColor.rgb - (smpColor.rgb * u_screenColor.rgb);"
279279 " smpColor = smpColor * u_baseColor;"
280280 " smpColor = vec4(smpColor.rgb * smpColor.a, smpColor.a);"
281281 " }"
282282 " gl_FragColor = smpColor;}" )
283- aL = ("#version 330 core \n "
284- "layout(location = 0) in vec2 a_position;"
285- "layout(location = 1) in vec2 a_texCoord;"
286- "out vec2 v_texCoord;"
287- "out vec4 v_clipPos;"
283+ aL = ("#version 120 \n "
284+ "attribute vec2 a_position;"
285+ "attribute vec2 a_texCoord;"
286+ "varying vec2 v_texCoord;"
287+ "varying vec4 v_clipPos;"
288288 "uniform mat4 u_mvpMatrix;"
289289 "uniform mat4 u_clipMatrix;"
290290 "void main(){"
@@ -293,22 +293,22 @@ def loadShaders2(self):
293293 " v_clipPos = u_clipMatrix * pos;"
294294 " v_texCoord = a_texCoord;"
295295 " v_texCoord.y = 1.0 - v_texCoord.y;}" )
296- aJ = ("#version 330 core \n "
297- "in vec2 v_texCoord;"
298- "in vec4 v_clipPos;"
296+ aJ = ("#version 120 \n "
297+ "varying vec2 v_texCoord;"
298+ "varying vec4 v_clipPos;"
299299 "uniform sampler2D s_texture0;"
300300 "uniform sampler2D s_texture1;"
301301 "uniform vec4 u_channelFlag;"
302302 "uniform vec4 u_baseColor;"
303303 "uniform vec4 u_screenColor;"
304304 "uniform vec4 u_multiplyColor;"
305305 "void main(){"
306- " vec4 col_formask = texture (s_texture0, v_texCoord);"
306+ " vec4 col_formask = texture2D (s_texture0, v_texCoord);"
307307 " col_formask.rgb = col_formask.rgb * u_multiplyColor.rgb;"
308308 " col_formask.rgb = col_formask.rgb + u_screenColor.rgb - (col_formask.rgb * u_screenColor.rgb);"
309309 " col_formask = col_formask * u_baseColor;"
310310 " col_formask.rgb = col_formask.rgb * col_formask.a;"
311- " vec4 clipMask = texture (s_texture1, v_clipPos.xy / v_clipPos.w) * u_channelFlag;"
311+ " vec4 clipMask = texture2D (s_texture1, v_clipPos.xy / v_clipPos.w) * u_channelFlag;"
312312 " float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;"
313313 " col_formask = col_formask * maskVal;"
314314 " gl_FragColor = col_formask;}" )
0 commit comments