Hello again!
I’m excerpting from a private Gist, but will see if it can’t be made public, or maybe it will be in the meantime. At one point these details were potentially in flux, but are basically frozen now.
Basically, where you would normally have vertex data, you would instead do
kernel.uniformData =
with the difference being that you also provide a type field.
Then in the kernels themselves you declare the uniform in the outer scope much like a varying, e.g. as
uniform P\_COLOR vec4 u\_UserData0; // pointLightColor
And some commentary to go with it:
Some explanation is due: You can declare up to 4 uniforms. They would be mapped to u_UserData0 - u_UserData3. You must declare them in kernels as shown. There are several acceptable types: “scalar”, “vec2”, “vec3”, “vec4”, “mat3”, “mat4”;
This will kill batching, so be careful with that.
I should have some stuff in this, which was a proof of concept of meshes. I think CalebP might have done something with it, but couldn’t find the links.