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/
331 stars 23 forks source link

Add GLSL Example #19

Open blghns opened 9 months ago

blghns commented 9 months 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 9 months ago

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

blghns commented 9 months ago

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

blghns commented 9 months ago

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

blghns commented 9 months ago

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