/usr/share/libavogadro/shaders/per_pixel2.frag is in avogadro-data 1.0.3-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | varying vec3 Normal;
varying vec3 Light;
varying vec3 HalfVector;
// max(abs( dot(n, Light) ),0.0) --> abs( dot(n, Light) ) to fix an issue with OpenMOIV
void main(void)
{
vec3 n = normalize(Normal);
vec4 Diffuse = ( gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse ) * abs( dot(n, Light) );
vec4 Ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;
Ambient += gl_LightModel.ambient * gl_FrontMaterial.ambient;
vec4 Specular = ( gl_FrontMaterial.specular * gl_LightSource[0].specular ) * pow(abs(dot(n,HalfVector)), gl_FrontMaterial.shininess );
gl_FragColor = Ambient + Diffuse + Specular;
}
|