For any future readers, i came across this:
https://stackoverflow.com/questions/69250608/is-my-webgl-fbo-color-attachment-being-cleared
I'm still not actually sure what caused it, but basically i was using React.useState
to store a texture, the moment i pass the "raw" texture reference (whatever is the result of calling regl.texture()
the texture would be reset. Took a while to realize that calling this function will "reset" the texture to 1x1.
Basically:
const [texture, setTexture] = useState(null)
....
const myTexture = regl.texture()
//barfed
setTexture(myTexture)
//worked
setTexture({myTexture})
#pragma
statements in the vertex shader specify attributes and varyings as well as functions for computing line geometry (vertex position and width). It sets up the correct attributes, strides, etc and handles all the other details