News for hackers. Stuff that matters.
Re:The Book of Shaders by khedoros1 on Thursday November 02, 2017 @12:56AM (#15607942)
As stated, the driver contains a shader compiler. Personally, I like to see examples, so here's a snippet of code that would compile a WebGL shader:

var gl = canvas.getContext('webgl');

var vShaderSource = document.getElementById('vShader');

var vShader = gl.createShader(gl.VERTEX_SHADER);

gl.shaderSource(vShader, vShaderSource);

gl.compileShader(vShaderSource);

"vShader" is the id of a <script> tag of type "x-shader/x-vertex". Get a WebGL context, get the shader source, create a shader object, bind the source to the shader, then compile the source.

There are no comments on this comment yet.