Arbitrary data matrix input for jit.gl.mesh


    Apr 06 2021 | 11:24 pm
    Hello,
    Please excuse me if this question has been answered before. I searched the forum but couldn't find an answer.
    I'm wondering what the best way would be to set a custom vertex attribute matrix for jit.gl.mesh for use within the shader. For example, say I had the jit.gl.mesh set to '@draw_mode points' and I wanted to specify a matrix with different point_size values for each vertex. I suppose I could re-purpose one of the other matrix inputs such as the edgeflag_matrix, and use the values to size gl_PointSize in the vertex shader, but is there a cleaner way to do this?
    Thanks!
    Conor

    • Apr 07 2021 | 3:54 pm
      search the File Browser for custom.vertex.attribute.maxpat for an example.
      vertex attributes must be tagged in the JXS as state="VERTEX_ATTR" and declared as type attribute.
      Then the data is sent via the vertex_attr_matrix message followed by the matrix name.
    • Apr 07 2021 | 4:02 pm
      Awesome, thank you!