小编kus*_*sma的帖子

优化重片段着色器的性能

我需要帮助优化以下一组着色器:

顶点:

    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)

shader android opengl-es opengl-es-2.0 mali

5
推荐指数
1
解决办法
6310
查看次数

标签 统计

android ×1

mali ×1

opengl-es ×1

opengl-es-2.0 ×1

shader ×1