BRDF Toy

A BRDF (Bidirectional Reflectance Distribution Function), written f(l,v), gives the amount of incoming light energy from direction l that turns into outgoing light energy in direction v. It is written with respect to a surface patch whose normal points upward.

Some good notes about BRDFs used in physically-based shading systems:

varying highp vec3 vPosition;
varying highp vec3 vNormal;
varying highp vec3 vTangent;
varying highp vec3 vBitangent;
varying highp vec4 vColor;
varying highp vec2 vUV;
uniform highp vec3 uCamera;
uniform highp vec3 uLightPosition;
uniform highp vec3 uLightEnergy;
uniform highp float uRoughness;
uniform sampler2D uNormalMap;
void main() {
highp float shininess = pow(1024.0, 1.0 - uRoughness);
highp vec3 n = normalize(vNormal);
highp vec3 v = normalize(uCamera - vPosition);
//--------------
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
uLightEnergy r:1.00 g:1.00 b:1.00 * intensity:2.0
uRoughness:1.00
uLightPosition x:0.00 y:0.00 z:5.00