Permalink
Browse files

Shader cleanup

  • Loading branch information...
1 parent 52e8257 commit c447fa4fe0d97c7dde29b5707e26acd96146d86b @njx njx committed Sep 27, 2012
Showing with 12 additions and 24 deletions.
  1. BIN below-flat.png
  2. BIN below.png
  3. +1 −7 shader.fs
  4. +1 −7 shader.vs
  5. +10 −10 styles.css
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -18,9 +18,6 @@ precision mediump float;
// Uniforms passed in from CSS
-uniform vec4 backColor;
-uniform float useColoredBack;
-
// Varyings
varying float v_lighting;
@@ -29,9 +26,6 @@ varying float v_lighting;
void main()
{
- if (!gl_FrontFacing && useColoredBack >= 0.5)
- css_MixColor = v_lighting * backColor;
- else
- css_MixColor = vec4(v_lighting);
+ css_MixColor = vec4(v_lighting);
css_MixColor.a = 1.0;
}
View
@@ -30,13 +30,8 @@ uniform vec2 u_textureSize;
// Uniforms passed-in from CSS
uniform mat4 transform;
-
-uniform float direction;
-
uniform float mapDepth;
-
uniform float t;
-uniform float shadow;
// Varyings
@@ -52,10 +47,9 @@ void main()
{
vec4 pos = a_position;
float ramp = step(0.5, 1.0 - a_meshCoord.y) * a_meshCoord.y + step(0.5, a_meshCoord.y) * (1.0 - a_meshCoord.y);
- float zOffset = ramp * -50.0;
float adjT = t * 0.999; // don't get to the end to avoid overlap
- pos.z = zOffset * mapDepth * adjT - mapDepth * adjT / 2.0;
+ pos.z = ramp * -50.0 * mapDepth * adjT;
pos.y = (pos.y + 0.5) * (1.0 - adjT) - 0.5;
v_lighting = 1.0 - (ramp * adjT * 0.5);
View
@@ -28,46 +28,46 @@
}
.doFold {
- -webkit-animation-duration: 0.4s;
+ -webkit-animation-duration: 0.3s;
-webkit-animation-name: fold;
-webkit-animation-fill-mode: forwards;
-webkit-animation-timing-function: ease-in;
}
.doUnfold {
- -webkit-animation-duration: 0.4s;
+ -webkit-animation-duration: 0.3s;
-webkit-animation-name: unfold;
-webkit-animation-fill-mode: forwards;
-webkit-animation-timing-function: ease-in;
}
@-webkit-keyframes fold {
from {
- -webkit-filter: custom(url(shader.vs) mix(url(shader.fs) multiply source-atop), 2 2 border-box, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), t 0, mapDepth 5, useColoredBack 1, backColor 1 1 1 1, direction 0, shadow 0);
+ -webkit-filter: custom(url(shader.vs) mix(url(shader.fs) multiply source-atop), 2 2 border-box, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), t 0, mapDepth 5);
}
to {
- -webkit-filter: custom(url(shader.vs) mix(url(shader.fs) multiply source-atop), 2 2 border-box, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), t 1, mapDepth 5, useColoredBack 1, backColor 1 1 1 1, direction 0, shadow 0);
+ -webkit-filter: custom(url(shader.vs) mix(url(shader.fs) multiply source-atop), 2 2 border-box, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), t 1, mapDepth 5);
}
}
@-webkit-keyframes unfold {
from {
- -webkit-filter: custom(url(shader.vs) mix(url(shader.fs) multiply source-atop), 2 2 border-box, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), t 1, mapDepth 5, useColoredBack 1, backColor 1 1 1 1, direction 0, shadow 0);
+ -webkit-filter: custom(url(shader.vs) mix(url(shader.fs) multiply source-atop), 2 2 border-box, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), t 1, mapDepth 5);
}
to {
- -webkit-filter: custom(url(shader.vs) mix(url(shader.fs) multiply source-atop), 2 2 border-box, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), t 0, mapDepth 5, useColoredBack 1, backColor 1 1 1 1, direction 0, shadow 0);
+ -webkit-filter: custom(url(shader.vs) mix(url(shader.fs) multiply source-atop), 2 2 border-box, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), t 0, mapDepth 5);
}
}
.doBelowFold {
- -webkit-animation-duration: 0.4s;
+ -webkit-animation-duration: 0.3s;
-webkit-animation-name: slideUp;
-webkit-animation-fill-mode: forwards;
-webkit-animation-timing-function: ease-in;
}
.doBelowUnfold {
- -webkit-animation-duration: 0.4s;
+ -webkit-animation-duration: 0.3s;
-webkit-animation-name: slideDown;
-webkit-animation-fill-mode: forwards;
-webkit-animation-timing-function: ease-in;
@@ -105,14 +105,14 @@
}
.collapse {
- -webkit-animation-duration: 0.4s;
+ -webkit-animation-duration: 0.3s;
-webkit-animation-name: collapse;
-webkit-animation-fill-mode: forwards;
-webkit-animation-timing-function: ease-in;
}
.expand {
- -webkit-animation-duration: 0.4s;
+ -webkit-animation-duration: 0.3s;
-webkit-animation-name: expand;
-webkit-animation-fill-mode: forwards;
-webkit-animation-timing-function: ease-in;

0 comments on commit c447fa4

Please sign in to comment.