Created
September 30, 2012 10:12
-
-
Save andrespagella/3806386 to your computer and use it in GitHub Desktop.
CSS Custom Filter (a fragment shader) is not working
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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