¼
ðattribute vec4 pos;
attribute vec4 texcoord;
attribute vec4 normal;
attribute vec4 tangent;
attribute vec4 texcoord1;
uniform mat4 Alice_Matrix_M;
uniform mat4 Alice_Matrix_V;
uniform mat4 Alice_Matrix_P;
uniform mat4 Alice_Matrix_IT_M;

uniform vec4 Alice_CameraWorldPos;

uniform vec4 Alice_AmbientMaterial;
uniform vec4 Alice_DiffuseMaterial;
uniform vec4 Alice_SpecularMaterial;
uniform vec4 Alice_OtherFactor;

uniform vec4 Alice_LightFlag0;
uniform vec4 Alice_LightFlag1;

uniform vec4 Alice_LightPos0;
uniform vec4 Alice_LightAmbient0;
uniform vec4 Alice_LightDiffuse0;
uniform vec4 Alice_LightSpecular0;

varying vec4 V_Color;

vec4 GetLight0Color(vec3 world_pos,vec3 n){
	vec4 specularColor=vec4(0.0,0.0,0.0,0.0);
	vec3 lightPos=Alice_LightPos0.xyz;
	vec3 L=lightPos;
	L=normalize(L);
	vec4 ambientColor=Alice_LightAmbient0*Alice_AmbientMaterial;
	float diffuseIntensity=max(0.0,dot(L,n));
	vec4 diffuseColor=Alice_LightDiffuse0*Alice_DiffuseMaterial*diffuseIntensity;
	if(diffuseIntensity!=0.0){
		//blin-phong light model
		vec3 viewDir=normalize(Alice_CameraWorldPos.xyz-world_pos);
		vec3 halfVector=normalize(L+viewDir);
		specularColor=Alice_LightSpecular0*Alice_SpecularMaterial*pow(max(0.0,dot(n,halfVector)),Alice_OtherFactor.x);
	}
	return ambientColor+diffuseColor+specularColor;
}
void main()
{
	vec3 normal=(Alice_Matrix_IT_M*normal).xyz;
	vec3 n=normalize(normal);
	vec4 world_pos=Alice_Matrix_M*pos;
	V_Color=vec4(0.0,0.0,0.0,0.0);
	if(Alice_LightFlag0.x==1.0){
		V_Color=V_Color+GetLight0Color(world_pos.xyz,n);
	}
	gl_Position=Alice_Matrix_P*Alice_Matrix_V*world_pos;
}G
varying vec4 V_Color;

void main()
{
    gl_FragColor=V_Color;
} dc1b835e7ccd11e78b2dfcaa14d464d5