Skip to content

Instantly share code, notes, and snippets.

@andrespagella
Created September 30, 2012 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrespagella/3806386 to your computer and use it in GitHub Desktop.
Save andrespagella/3806386 to your computer and use it in GitHub Desktop.
CSS Custom Filter (a fragment shader) is not working
/* redtint.fs */
precision mediump float;
void main()
{
css_ColorMatrix = mat4(1.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 1.0);
}
/* HTML + CSS */
<!DOCTYPE html>
<html>
<head>
<title>CSS Custom Filters - Example</title>
<style type="text/css" media="screen">
img { width: 300px; }
#img1 {
-webkit-filter: custom(none url(redtint.fs));
}
</style>
</head>
<body>
<img id="img1" src="dog.jpg" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment