为什么我的用于点的openGL着色器程序有绑带工件?

Ste*_*lus 6 shader android opengl-es glsl opengl-es-2.0

对于我的OpenGL着色器程序所采用的每个点,它创建一个红色环,在不透明和完全透明之间平滑过渡.我的着色器程序有效,但有绑定工件.

片段着色器如下.

#version 110

precision mediump float;

void main() {
 float dist = distance(gl_PointCoord.xy, vec2(0.5, 0.5));

 // Edge value is 0.5, it should be 1.
 // Inner most value is 0 it should stay 0.
 float inner_circle = 2.0 * dist;
 float circle = 1.0 - inner_circle;

 vec4 pixel = vec4(1.0, 0.0, 0.0, inner_circle * circle );

 gl_FragColor = pixel;
}
Run Code Online (Sandbox Code Playgroud)

这是不太有趣的顶点着色器,我认为不是导致问题的原因.

#version 110

attribute vec2 aPosition;

uniform float uSize;
uniform vec2 uCamera;

void main() {
 // Square the view and map the top of the screen to 1 and the bottom to -1.

 gl_Position = vec4(aPosition, 0.0, 1.0); 
 gl_Position.x = gl_Position.x * uCamera.y / uCamera.x;

 // Set point size
 gl_PointSize = (uSize + 1.0) * 100.0;
}
Run Code Online (Sandbox Code Playgroud)

请帮我弄清楚,为什么我的OpenGL着色器程序有绑带工件?

PS顺便提一下,这是一款Android Acer Iconia平板电脑.

die*_*etr 2

Android 的 GLSurfaceView 默认使用 RGB565 表面。启用抖动 ( glEnable(GL_DITHER)) 或安装自定义选项EGLConfigChooser以选择每通道 8 位的 RGBA 或 RGBX 表面配置。