初次提交
This commit is contained in:
9
第17章 游戏的心脏——物理引擎/Sample17_1/assets/frag.sh
Normal file
9
第17章 游戏的心脏——物理引擎/Sample17_1/assets/frag.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
precision mediump float;
|
||||
varying vec2 vTextureCoord;//接收从顶点着色器过来的参数
|
||||
uniform sampler2D sTexture;//纹理内容数据
|
||||
|
||||
void main()
|
||||
{
|
||||
//给此片元颜色值
|
||||
gl_FragColor = texture2D(sTexture, vTextureCoord);
|
||||
}
|
||||
12
第17章 游戏的心脏——物理引擎/Sample17_1/assets/vertex.sh
Normal file
12
第17章 游戏的心脏——物理引擎/Sample17_1/assets/vertex.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
uniform mat4 uMVPMatrix; //总变换矩阵
|
||||
attribute vec3 aPosition; //顶点位置
|
||||
attribute vec2 aTexCoor; //顶点纹理坐标
|
||||
varying vec2 vTextureCoord; //传给着色器的纹理坐标
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = uMVPMatrix * vec4(aPosition,1); //根据总变换矩阵计算此次绘制此顶点位置
|
||||
|
||||
vTextureCoord=aTexCoor;
|
||||
}
|
||||
Reference in New Issue
Block a user