1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
//FallBack01_Bump_Light.fragment
in vec3 vLightDir;
in vec3 vUv;
in vec3 vLightPos;
OUTPUT
uniform samplerCube tex0; //normalizedVecMap
uniform sampler2D tex1; //normalMap
uniform sampler3D tex2; //attenuation
void main() {
vec4 nv = textureCube(tex0, vLightDir);
vec4 norm = texture(tex1, vUv.st);
vec4 attenuation = texture3D(tex2, vLightPos);
outColor = vec4(4*((nv.r - 0.5)*(norm.r - 0.5) + (nv.g - 0.5)*(norm.g - 0.5) + (nv.b - 0.5)*(norm.b - 0.5)));
outColor.a *= attenuation.g;
}
|