所以我在屏幕的某个……嗯……点上绘制一个点,然后该点四处移动。我的顶点着色器看起来像这样。
private final String vertexShaderCode =
"attribute vec4 vPosition;" +
"uniform mat4 Projection; \n" +
"uniform mat4 ModelView; \n" +
"void main() {" +
" gl_Position = Projection * ModelView * vPosition;" +
" gl_PointSize = 900.0; " +
"}";
Run Code Online (Sandbox Code Playgroud)
我想要实现的是围绕这个顶点的位置渲染一个圆。为此,我使用片段着色器:
private final String fragmentShaderCode =
"precision highp float; \n" +
"uniform vec2 aCirclePosition; \n" +
"uniform float aRadius; \n" +
"uniform vec4 aColor; \n" +
"const float threshold = 0.3;\n" +
"void main() \n" +
"{ \n" +
" …Run Code Online (Sandbox Code Playgroud)