Commit dd689519 authored by Jan Möbius's avatar Jan Möbius

Removed unused old directory



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16082 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7fa74d10
#define SHININESS g_vMaterial.x
#define TRANSPARENCY g_vMaterial.y
#define ALPHA g_vMaterial.y
vec3 LitPointLight(vec3 vPosition,
vec3 vNormal,
vec3 vLightPos,
vec3 cLightAmbient,
vec3 cLightDiffuse,
vec3 cLightSpecular,
vec3 vLightAtten)
{
vec3 vLightVS = vPosition - vLightPos;
float fLen2 = dot(vLightVS, vLightVS);
float fLen = sqrt(fLen2);
vec3 vLightDir = vLightVS / fLen;
// ambient
vec3 cLight = cLightAmbient * g_cAmbient;
// diffuse
float ldotn = clamp(dot(vLightDir, vNormal), 0.0, 1.0);
cLight += ldotn * cLightDiffuse * g_cDiffuse;
// specular
vec3 h = normalize(vLightDir - normalize(vPosition)); // half vector between light and view direction
float hdotn = max(dot(h, vNormal), 0.0);
cLight += (pow(hdotn, SHININESS) * cLightSpecular) * g_cSpecular;
// attenuate
float fAtten = vLightAtten.x + vLightAtten.y * fLen + vLightAtten.z * fLen2;
return cLight / fAtten;
}
vec3 LitDirLight(vec3 vPosition,
vec3 vNormal,
vec3 vLightDir,
vec3 cLightAmbient,
vec3 cLightDiffuse,
vec3 cLightSpecular)
{
// ambient
vec3 cLight = cLightAmbient * g_cAmbient;
// diffuse
float ldotn = clamp(dot(vLightDir, vNormal), 0.0, 1.0);
cLight += ldotn * cLightDiffuse * g_cDiffuse;
// specular
vec3 h = normalize(vLightDir - normalize(vPosition)); // half vector between light and view direction
float hdotn = max(dot(h, vNormal), 0.0);
cLight += (pow(hdotn, SHININESS) * cLightSpecular) * g_cSpecular;
return cLight;
}
vec3 LitSpotLight(vec3 vPosition,
vec3 vNormal,
vec3 vLightPos,
vec3 vSpotLightDir,
vec3 cLightAmbient,
vec3 cLightDiffuse,
vec3 cLightSpecular,
vec3 vLightAtten,
vec2 vLightSpotAngleExp)
{
vec3 vLightVS = vPosition - vLightPos;
float fLen2 = dot(vLightVS, vLightVS);
float fLen = sqrt(fLen2);
vec3 vLightDir = vLightVS / fLen;
// ambient
vec3 cLight = cLightAmbient * g_cAmbient;
// diffuse
float ldotn = clamp(dot(vLightDir, vNormal), 0.0, 1.0);
cLight += ldotn * cLightDiffuse * g_cDiffuse;
// specular
vec3 h = normalize(vLightDir - normalize(vPosition)); // half vector between light and view direction
float hdotn = max(dot(h, vNormal), 0.0);
cLight += (pow(hdotn, SHININESS) * cLightSpecular) * g_cSpecular;
// attenuate
float fAtten = vLightAtten.x + vLightAtten.y * fLen + vLightAtten.z * fLen2;
// spot angle falloff
float fSpot = -dot(vLightDir, vSpotLightDir);
fSpot *= step(vLightSpotAngleExp.x, fSpot);
fSpot *= pow(fSpot, vLightSpotAngleExp.y);
return cLight * (fSpot / fAtten);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment