## specular (`lygia`/`lighting`/`specular`)

Calculate specular contribution

Dependencies:

Use:

``````specular(<vec3> L, <vec3> N, <vec3> V, <float> roughness[, <float> fresnel])
``````
``````specular(<vec3> L, <vec3> N, <vec3> V, <float> NoV, <float> NoL, <float> roughness, <float> fresnel)
``````

Check it on Github

``````

#ifndef SPECULAR_FNC
#if defined(TARGET_MOBILE) || defined(PLATFORM_RPI) || defined(PLATFORM_WEBGL)
#define SPECULAR_FNC specularBlinnPhongRoughnes
#else
#define SPECULAR_FNC specularCookTorrance
#endif
#endif

#ifndef FNC_SPECULAR
#define FNC_SPECULAR
float specular(const in vec3 L, const in vec3 N, const in vec3 V, const in float roughness) { return SPECULAR_FNC(L, N, V, roughness); }
float specular(const in vec3 L, const in vec3 N, const in vec3 V, const in float roughness, const in float fresnel) { return SPECULAR_FNC(L, N, V, roughness, fresnel); }
float specular(const in vec3 L, const in vec3 N, const in vec3 V, const in float NoV, const in float NoL, const in float roughness, const in float fresnel) { return SPECULAR_FNC(L, N, V, NoV, NoL, roughness, fresnel); }
#endif
``````

Dependencies:

Use:

``````specular(<float3> L, <float3> N, <float3> V, <float> roughness[, <float> fresnel])
``````
``````specular(<float3> L, <float3> N, <float3> V, <float> NoV, <float> NoL, <float> roughness, <float> fresnel)
``````

Check it on Github

``````

#ifndef SPECULAR_FNC
#if defined(TARGET_MOBILE) || defined(PLATFORM_RPI) || defined(PLATFORM_WEBGL)
#define SPECULAR_FNC specularBlinnPhongRoughnes
#else
#define SPECULAR_FNC specularCookTorrance
#endif
#endif

#ifndef FNC_SPECULAR
#define FNC_SPECULAR
float specular(float3 L, float3 N, float3 V, float roughness) { return SPECULAR_FNC(L, N, V, roughness); }
float specular(float3 L, float3 N, float3 V, float roughness, float fresnel) { return SPECULAR_FNC(L, N, V, roughness, fresnel); }
float specular(float3 L, float3 N, float3 V, float NoV, float NoL, float roughness, float fresnel) { return SPECULAR_FNC(L, N, V, NoV, NoL, roughness, fresnel); }
#endif
``````