//pref
Ambient|float|0.0|0.4|1
Diffuse|float|0.0|0.8|1
Specular|float|0.0|0.55|1
Roughness|float|0.001|0.05|0.5
AnisoRoughness|float|0.001|0.5|1
Heidrich-Seidel anisotropic specularity.  specularity. Adapted from Fluxus Library, Copyright 2007 Dave Griffiths, GPLv2|note
//vert
#version 330
layout(location = 0) in vec3 Vert;
layout(location = 3) in vec3 Norm;
layout(location = 6) in vec4 Clr;
out vec3 vN, vL, vV;
out vec4 vClr, vP;
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ModelViewMatrix;
uniform mat3 NormalMatrix;
uniform vec3 LightPos = vec3(0.0, 20.0, 30.0); //LR, -DU+, -FN+
void main() {
    vN = normalize((NormalMatrix * Norm));
    vP = vec4(Vert, 1.0);
    gl_Position = ModelViewProjectionMatrix * vec4(Vert, 1.0);
    vL = normalize(LightPos);
    vV = -vec3(ModelViewMatrix*vec4(Vert,1.0));
    vClr = Clr;
}
//frag
#version 330
in vec4 vClr, vP;
in vec3 vN, vL, vV;
out vec4 color;
uniform float Ambient = 0.4;
uniform float Diffuse = 0.7;
uniform float Specular = 0.6;
uniform float Roughness = 0.1;
uniform float AnisoRoughness = 0.001;
uniform vec4 ClipPlane = vec4(2.0, 0.0, 0.0, 0.0);

vec3 desaturate(vec3 color, float amount) {
    vec3 gray = vec3(dot(vec3(0.2126,0.7152,0.0722), color));
    return vec3(mix(color, gray, amount));
}

void main() {
 if ((ClipPlane[0] < 1.5) && (dot( ClipPlane, vP) > 0.0)) discard;
 vec3 n = normalize(vN);
 vec3 v = normalize(vV);
 vec3 h = normalize(vL+v);
 float diffuse = dot(vL,n);
 vec3 AmbientColor = vClr.rgb;
 vec3 DiffuseColor = vClr.rgb;
 if (n.z < 0.0) { //treat backfaces differently
 	vec3 backsurface = desaturate(AmbientColor*Ambient * 0.75 +
          DiffuseColor*abs(diffuse)*Diffuse * 0.75, 0.5);
  color = vec4(backsurface, 1.0);
  return;
 }
 vec3 SpecularColor = vec3(1.0, 1.0, 1.0);
 float specular =  pow(max(0.0,dot(n,h)),1.0/(Roughness * Roughness));
 vec3 SpecDirection = vec3(0.0, 0.0, 1.0);
 vec3 t = cross(n,normalize(SpecDirection));
 // Heidrich-Seidel anisotropic distribution
 float ldott = dot(vL,t);
 float vdott = dot(v,t);
 float aniso = pow(sin(ldott)*sin(vdott) +
                      cos(ldott)*cos(vdott),1.0/(AnisoRoughness*AnisoRoughness));
 aniso = sqrt(aniso);
 color = vec4(AmbientColor*Ambient + DiffuseColor*diffuse*Diffuse +aniso*SpecularColor*specular* Specular, 1.0);
}
// Copyright (C) 2007 Dave Griffiths
// Licence: GPLv2 (see COPYING)
// Fluxus Shader Library
// ---------------------
// Anisotropic Specular Reflection Shader
// This shader is useful for depicting surfaces
// such as velvet or brushed metal, as it allows
// you to stretch the highlight along the
// SpecDirection vector (in object space)
// http://www.pawfal.org/fluxus/
// https://github.com/danomatika/fluxus/blob/master/LICENCE