fix: 修改git忽略文件

This commit is contained in:
xiaoyan 2022-09-22 20:46:07 +08:00
parent 3740d114b8
commit 738afcb259
4 changed files with 20 additions and 5 deletions

View File

@ -14,4 +14,3 @@
.externalNativeBuild
.cxx
local.properties
/app/

View File

@ -0,0 +1,6 @@
precision mediump float;
varying vec4 vColor; //接收从顶点着色器过来的参数
void main()
{
gl_FragColor = vColor;//给此片元颜色值
}

View File

@ -0,0 +1,10 @@
uniform mat4 uMVPMatrix; //总变换矩阵
attribute vec3 aPosition; //顶点位置
attribute vec4 aColor; //顶点颜色
varying vec4 vColor; //用于传递给片元着色器的变量
void main()
{
gl_Position = uMVPMatrix * vec4(aPosition,1); //根据总变换矩阵计算此次绘制此顶点位置
vColor = aColor;//将接收的颜色传递给片元着色器
}

View File

@ -40,9 +40,9 @@ public class Triangle
final float UNIT_SIZE=0.2f;
float vertices[]=new float[]
{
-4*UNIT_SIZE,0,
0,0,-4*UNIT_SIZE,
0,4*UNIT_SIZE,0,0
-4*UNIT_SIZE,0, 0,
0,-4*UNIT_SIZE, 0,
4*UNIT_SIZE,0,0
};
ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length*4);
@ -55,7 +55,7 @@ public class Triangle
{
1,1,1,0,
0,0,1,0,
0,1,0,0
0,1,0,0,
};
ByteBuffer cbb = ByteBuffer.allocateDirect(colors.length*4);