output matrix of vertices from jit.gl.mesh
Hello,
I want to export the vertex positions from a jit.gl.mesh that is driven by transform feedback (jit.gl.tf, jit.gl.buffer) and potentially also includes a further shader that manipulates vertices (jit.gl.mesh @shader postProcess).
How to get the positions into a jit.gl.matrix?
Can I somehow write the vertex positions to a texture using the postProcess shader and get the matrix from a jit.gl.texture?
this is not currently possible, but I hope to add some functionality to map jit.gl.buffers to a jit.matrix at some future gl3 update. you may be able to write out position values as color output in the fragment stage, but this output is a fullscreen texture, with a position value written at every pixel, which may or may not be useful to you in your further post-processing.
Hello Rob, I would like to ask the question again. Is it meanwhile possible to get the vertex positions from jit.gl.mesh as a matrix?
jit.gl.buffer now has a map attribute that when set to a the name of an existing jit.matrix object, will write it's contents to that matrix every frame. Unfortunately it looks like this functionality hasn't been documented, but hopefully the attached patch demonstrates enough. sending map with no arguments clears the mapping.
happy to hear any feedback on this feature.
Thank you for this example Rob! What is the simplest way to access jit.gl.mesh data using buffer?