2
在我簡單的2D遊戲中,當使用ES 2.0實現進行繪製時,我有2倍的幀率下降。如果正確使用,它可以或2.0應該更快?OpenGL ES性能2.0與1.1(iPad)
P.S.如果你對細節感興趣。我用很簡單的着色器:
頂點程序:
uniform vec2 u_xyscale;
uniform vec2 u_st_to_uv;
attribute vec2 a_vertex;
attribute vec2 a_texcoord;
attribute vec4 a_diffuse;
varying vec4 v_diffuse;
varying vec2 v_texcoord;
void main(void)
{
v_diffuse = a_diffuse;
// convert texture coordinates from ST space to UV.
v_texcoord = a_texcoord * u_st_to_uv;
// transform XY coordinates from screen space to clip space.
gl_Position.xy = a_vertex * u_xyscale + vec2(-1.0, 1.0);
gl_Position.zw = vec2(0.0, 1.0);
}
片斷程序:
precision mediump float;
uniform sampler2D t_bitmap;
varying lowp vec4 v_diffuse;
varying vec2 v_texcoord;
void main(void)
{
vec4 color = texture2D(t_bitmap, v_texcoord);
gl_FragColor = v_diffuse * color;
}
謝謝!我會檢查這一點,並投票給您的答案,如果這將工作。 – 2010-12-24 16:11:30