javascript-journey icon indicating copy to clipboard operation
javascript-journey copied to clipboard

Add GLSL Example

Open blghns opened this issue 1 year ago • 4 comments

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");

blghns avatar Sep 28 '23 17:09 blghns

hehe, that is pretty nifty. Can you write the full code as a pull request, so I can include it?

bahmutov avatar Oct 03 '23 12:10 bahmutov

Will do, not an expert in shaders so this will take some time to implement 😄

blghns avatar Oct 03 '23 20:10 blghns

Also will try to add WebGPU Example https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API

blghns avatar Oct 03 '23 20:10 blghns

Here is an example fiddle I created for the glsl https://jsfiddle.net/bilgehansolo/cbj5o608/ I'll create a PR Soon

blghns avatar Oct 05 '23 03:10 blghns