text-shadow
glow
hover on glow
box-shadow
activate one of the text fields
shorthand filtersfilter: <short-hand-function>(<params>)
picture from iStockPhoto
svg filtersfilter: url(#svg-filter-id);
toggle filter
toggle controls
curved shadows
no extra markup or :before!!!
SVG filter graph example
01 <filter id="curved-shadow" ...>
02 <feFlood flood-color="black" flood-opacity="0.55" />
03 <feComposite in2="SourceAlpha" operator="in" result="coloredAlpha"/>
04 <feImage xlink:href="assets/images/slides/curved-disp.png"
... result="displacement"/>
05 <feDisplacementMap id="displacement" in2="displacement" in="coloredAlpha"
... result="displaced"/>
06 <feGaussianBlur stdDeviation="8" />
07 <feOffset id="displacementOffset" dx="0" dy="15"
result="displaced-blurred" />
08 <feMerge>
09 <feMergeNode in="displaced-blurred"/>
10 <feMergeNode in="SourceGraphic"/>
11 </feMerge>
12 </filter>
using shaders
00 <style>
01 #myElement {
02 filter: custom( <params> ) ;
04 }
05 </style>
custom()
00 <style>
01 #myElement {
02 filter: custom(<vertex-shader>
04 [ wsp <fragment-shader> ]
05 [, <vertex-mesh> ]
06 [, <params> ] );
07 }
08 </style>
vertex shader only
00 <style>
01 #myElement {
02 filter: custom(url(one-fold.vs), 2 2 );
03 }
04 </style>
field sunset
field sunset
with fragment shader
00 <style>
01 #myElement {
02 filter: custom(url(one-fold-2.vs)
03 url(one-fold-2.fs) , 2 2);
04 }
05 </style>
field sunset
field sunset
passing parameters
00 <style>
01 #myElement {
02 filter: custom(url(one-fold-3.vs)
03 url(one-fold-3.fs), 2 2,
04 amount 0.5 );
05 }
06 </style>
field sunset
field sunset
vertex shader
00 precision mediump float;
01 attribute vec4 a_position;
02 attribute vec2 a_texCoord;
03 const float MAX_AMOUNT = 0.5;
04 uniform float amount;
05 uniform mat4 u_projectionMatrix;
06 varying float shadow;
07 void main() {
08 vec4 pos = vec4( a_position );
09 float a = clamp(amount, 0.0, 1.0) * MAX_AMOUNT;
10 float t = 1.0 - abs(pos.x / 0.5);
11 pos.y = (pos.y + t * a) / (1.0 + a);
12 shadow = t;
13 gl_Position = u_projectionMatrix * pos;
14 }
fragment shader
00 precision mediump float;
01 varying float shadow;
02 uniform float amount;
02 void main() {
03 float a = 1.0 - 0.25 * amount * shadow;
04 css_BlendColor = vec4(a, a, a, 1.0);
05 }
texturing and blending
toggle blending
toggle opacity