bahmutov / javascript-journey

Source code for blog post Journey from procedural to reactive JavaScript with stops
http://glebbahmutov.com/blog/journey-from-procedural-to-reactive-javascript-with-stops/
332 stars 25 forks source link

Add GLSL Example #19

Open blghns opened 1 year ago

blghns commented 1 year ago

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");
bahmutov commented 1 year ago

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

blghns commented 1 year ago

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

blghns commented 1 year ago

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

blghns commented 1 year ago

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