glsl_fragment_shader
v1.0.0
Published
Implement a GLSL Fragment Shader into JavaScript
Downloads
4
Readme
GLSLFragmentShader
Implement a GLSL Fragment Shader into JavaScript
Check out this webgl shader at
http://davidclews.com/applications/programming/glsl/games_console_dashboard_background/index.html
The construct accepts two parameters, the first is the element is where the WebGL canvas will be added, and the second parameter is a string URL or a JSON object that contains the definition of the GLSL Fragment Shader. take a look at the example source code.
If your having issues implementing this take a look at the source code on my website.
Once the GLSL Fragment Shader has been loaded the GLSLFragmentShaderLoaded will be triggered on the parent element.
Full rules of the JSON Definition can be found at, http://www.davidclews.com/viewtopic.php?f=183&t=459
The size internally to GLSLFragmentShader Class effects the render size, the larger the size the more GPU power will be required. Use CSS css styles to stretch this. By using css styles on the canvas the GPU will not take any more Power
Within the JSON definition to mouse interaction can be enabled and disabled manually but if set it in the json definition it will default to that.
You can use all the fragment shaders from glslsandbox.com, by creating your own compatible JSON files, simply copy and paste then encode. Iv created a tool for this using tampermonkey it can be found at http://www.davidclews.com/viewtopic.php?f=23&p=964#p964 remember to support there project.