Fragment.glsl 338 Bytes
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
varying vec3 normal;
varying vec4 viewingDir;

uniform sampler2D texSamplerTMU0;

void main()
{      

	vec3 viewingDirCut = vec3(viewingDir.x, viewingDir.y, viewingDir.z);
	float angle = dot ( normal , viewingDirCut );

	vec2 coord;
	coord.s = angle/3.14;
	coord.t = angle/3.14;

	gl_FragColor = texture2D (texSamplerTMU0 , coord) ;

}