初次提交
This commit is contained in:
16
第9章 3D模型加载/Sample9_4/assets/frag.sh
Normal file
16
第9章 3D模型加载/Sample9_4/assets/frag.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
precision mediump float;
|
||||
uniform sampler2D sTexture;//纹理内容数据
|
||||
//接收从顶点着色器过来的参数
|
||||
varying vec4 ambient;
|
||||
varying vec4 diffuse;
|
||||
varying vec4 specular;
|
||||
varying vec2 vTextureCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
//将计算出的颜色给此片元
|
||||
vec4 finalColor=texture2D(sTexture, vTextureCoord);
|
||||
//给此片元颜色值
|
||||
gl_FragColor = finalColor*ambient+finalColor*specular+finalColor*diffuse;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user