我需要帮助优化以下一组着色器:
顶点:
precision mediump float;
uniform vec2 rubyTextureSize;
attribute vec4 vPosition;
attribute vec2 a_TexCoordinate;
varying vec2 tc;
void main() {
gl_Position = vPosition;
tc = a_TexCoordinate;
}
Run Code Online (Sandbox Code Playgroud)
分段:
precision mediump float;
/*
Uniforms
- rubyTexture: texture sampler
- rubyTextureSize: size of the texture before rendering
*/
uniform sampler2D rubyTexture;
uniform vec2 rubyTextureSize;
uniform vec2 rubyTextureFract;
/*
Varying attributes
- tc: coordinate of the texel being processed
- xyp_[]_[]_[]: a packed coordinate for 3 areas within the texture
*/
varying vec2 …Run Code Online (Sandbox Code Playgroud)