https://en.wikipedia.org/wiki/Schlick%27s_approximation
http://filmicworlds.com/blog/everything-has-fresnel/
float NdotL = max( 0.0, dot( PixelNormal, LightDir ) );
float fresnelFactor = SpecularColor + ( 1.0 - SpecularColor ) * pow( ( 1.0 - NdotL ), 5.0 );For microfacet models :
vec3 halfwayVector = normalize(viewDirection + light);
float HdotL = max( 0.0, dot( halfwayVector, light ) );
float fresnelFactor = SpecularColor + ( 1.0 - SpecularColor ) * pow( ( 1.0 - HdotL ), 5.0 );https://www.youtube.com/watch?v=gIeCnJbb_UI
https://en.wikipedia.org/wiki/Lambertian_reflectance
float product = dot(normalize(vNormal), light);
float brightness = max(0.0, product);https://developer.valvesoftware.com/wiki/Half_Lambert
float product = dot(normalize(vNormal), light);
float brightness = pow(product * 0.5 + 0.5, 2.0);float product = dot(normalize(vNormal), light);
float brightness = pow(max(0.0, product * multiply + add), power);Model created for rough surfaces (concrete, plaster, sand, cardboard, etc.).
https://en.wikipedia.org/wiki/Oren%E2%80%93Nayar_reflectance_model
http://www1.cs.columbia.edu/CAVE/projects/oren/
float LdotV = dot(light, viewDirection);
float NdotL = dot(light, surfaceNormal);
float NdotV = dot(surfaceNormal, viewDirection);
float s = LdotV - NdotL * NdotV;
float t = mix(1.0, max(NdotL, NdotV), step(0.0, s));
float sigma2 = roughness * roughness;
float A = 1.0 + sigma2 * (albedo / (sigma2 + 0.13) + 0.5 / (sigma2 + 0.33));
float B = 0.45 * sigma2 / (sigma2 + 0.09);
float brightness = albedo + max(0.0, NdotL) * (A + B * s / t) / PI;// TOCHECK
https://www.youtube.com/watch?v=hYKK4rIAB48
https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model
// vector from the surface pointing to the camera
vec3 directionToCamera = normalize(cameraPosition - vPosition);
// vector between the previous surface-to-camera vector and surface-to-light vector
vec3 halfwayVector = normalize(directionToCamera + light);
float specularBrightness = specularAmount * (
pow(
max(0.0, dot(vNormal, halfwayVector)),
specularShininess
)
);// TODO
Model designed for rough surfaces.
// TODO
http://www.neilblevins.com/cg_education/ggx/ggx.htm
http://www.shlyaev.com/rnd/37-cpp-category/54-ggx
https://github.com/glslify/glsl-ggx/blob/master/index.glsl
http://filmicworlds.com/blog/optimizing-ggx-shaders-with-dotlh/
http://filmicworlds.com/blog/optimizing-ggx-update/
https://en.wikipedia.org/wiki/Specular_highlight#Beckmann_distribution
https://github.com/glslify/glsl-specular-beckmann
vec3 halfwayVector = normalize(directionToCamera + light);
float NdotH = max(dot(surfaceNormal, halfwayVector), 0.0001);
float cos2Alpha = NdotH * NdotH;
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
float roughness2 = roughness * roughness;
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
return exp(tan2Alpha / roughness2) / denom;