javascript-journey
javascript-journey copied to clipboard
Add GLSL Example
Add missing GLSL example
// in shader
uniform vec4 a_vec4 = vec4(1, 2, 3, 4);
uniform vec4 b_vec4 = a * 2.0;
// in JavaScript at init time
var someVec2Loc = gl.getUniformLocation(someProgram, "b_vec4");
hehe, that is pretty nifty. Can you write the full code as a pull request, so I can include it?
Will do, not an expert in shaders so this will take some time to implement 😄
Also will try to add WebGPU Example https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API
Here is an example fiddle I created for the glsl https://jsfiddle.net/bilgehansolo/cbj5o608/ I'll create a PR Soon