Const fragmentShaderText
fragmentShaderText: "precision highp float;uniform sampler2D colorScale;uniform sampler2D grayScale;// varying float intensity;varying vec2 readPos;void main(void) {float intensity = texture2D(grayScale, readPos).a;if (intensity <= 0.0)discard;vec4 color = texture2D(colorScale, vec2(intensity, 0.5));color = color * intensity;gl_FragColor = color;}" = `precision highp float;uniform sampler2D colorScale;uniform sampler2D grayScale;// varying float intensity;varying vec2 readPos;void main(void) {float intensity = texture2D(grayScale, readPos).a;if (intensity <= 0.0)discard;vec4 color = texture2D(colorScale, vec2(intensity, 0.5));color = color * intensity;gl_FragColor = color;}`
Const vertexShaderText
vertexShaderText: "precision highp float;attribute vec2 pos;varying vec2 readPos;void main(void) {// intensity = texture2D(grayScale, pos).a;// color = texture2D(grayScale, vec2(pos.x * 1280.0, pos.y * 500.0));// color = texture2D(colorScale, vec2(0.5, 1.0));readPos = pos;gl_Position = vec4(pos * 2.0 - 1.0,0.0, 1.0);}" = `precision highp float;attribute vec2 pos;varying vec2 readPos;void main(void) {// intensity = texture2D(grayScale, pos).a;// color = texture2D(grayScale, vec2(pos.x * 1280.0, pos.y * 500.0));// color = texture2D(colorScale, vec2(0.5, 1.0));readPos = pos;gl_Position = vec4(pos * 2.0 - 1.0,0.0, 1.0);}`