初次提交
This commit is contained in:
14
第10章 混合与雾/Sample10_2/assets/frag_moon.sh
Normal file
14
第10章 混合与雾/Sample10_2/assets/frag_moon.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
//月球着色器
|
||||
precision mediump float;
|
||||
varying vec2 vTextureCoord;//接收从顶点着色器过来的参数
|
||||
varying vec4 vAmbient;
|
||||
varying vec4 vDiffuse;
|
||||
varying vec4 vSpecular;
|
||||
uniform sampler2D sTexture;//纹理内容数据
|
||||
void main()
|
||||
{
|
||||
//给此片元从纹理中采样出颜色值
|
||||
vec4 finalColor = texture2D(sTexture, vTextureCoord);
|
||||
//给此片元颜色值
|
||||
gl_FragColor = finalColor*vAmbient+finalColor*vSpecular+finalColor*vDiffuse;
|
||||
}
|
||||
Reference in New Issue
Block a user