fix: 修改git忽略文件
This commit is contained in:
parent
3740d114b8
commit
738afcb259
1
MyOpenGLLearn/.gitignore
vendored
1
MyOpenGLLearn/.gitignore
vendored
@ -14,4 +14,3 @@
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
/app/
|
||||
|
6
MyOpenGLLearn/app/src/main/assets/frag.glsl
Normal file
6
MyOpenGLLearn/app/src/main/assets/frag.glsl
Normal file
@ -0,0 +1,6 @@
|
||||
precision mediump float;
|
||||
varying vec4 vColor; //接收从顶点着色器过来的参数
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vColor;//给此片元颜色值
|
||||
}
|
10
MyOpenGLLearn/app/src/main/assets/vertex.glsl
Normal file
10
MyOpenGLLearn/app/src/main/assets/vertex.glsl
Normal 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;//将接收的颜色传递给片元着色器
|
||||
}
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user