Skeletal animation example shaders, code cleanup, etc.

This commit is contained in:
saschawillems 2016-10-30 18:13:49 +01:00
parent 54ddca7c08
commit 1359058d24
11 changed files with 65 additions and 121 deletions

View file

@ -19,14 +19,13 @@ void main()
float distSqr = dot(inLightVec, inLightVec);
vec3 lVec = inLightVec * inversesqrt(distSqr);
float invRadius = 1.0/4500.0;
float atten = max(clamp(1.0 - invRadius * sqrt(distSqr), 0.0, 1.0), 0.0);
const float attInvRadius = 1.0/5000.0;
float atten = max(clamp(1.0 - attInvRadius * sqrt(distSqr), 0.0, 1.0), 0.0);
// Fake drop shadow
invRadius = 1.0/2500.0;
float dropshadow = max(clamp(1.0 - invRadius * sqrt(distSqr), 0.0, 1.0), 0.0);
const float shadowInvRadius = 1.0/2500.0;
float dropshadow = max(clamp(1.0 - shadowInvRadius * sqrt(distSqr), 0.0, 1.0), 0.0);
outFragColor = vec4(color.g * (1.0 - dropshadow));
outFragColor = vec4(color.rgba * (1.0 - dropshadow));
outFragColor.rgb *= atten;
}