jit.gl.texture and dstdimstart | dstdimend


    Dec 16 2009 | 12:34 pm
    i'd like to change only a part of an existing jit.gl.texture and tried doing so by using dstdimstart and dstdimend (and setting usedstdim to 1).
    but that does not seem to work.
    is there
    a) a better / different way to achieve this or
    b) am i doing something wrong ?
    any help very much appreciated,
    thanks a lot,
    hannes koecher
    here's a testpatch:

    • Dec 18 2009 | 8:07 pm
      thanks for the report. i'll take a look.
    • Jan 20 2010 | 11:22 am
      any news on this one ?
      curious,
      hannes
    • Mar 14 2012 | 10:14 pm
      having the same problem and the same question
      1) is dstdimstart and dstdimend not working in jit.gl.texture ?
      2) a better / different way to achieve this ?
      best,
      l.
    • Mar 17 2012 | 9:52 pm
      hi. thanks for bringing this to our attention. it looks like this got broke again with max 6.
      i'll get it fixed up for a future update.
      you will want to use the message "subtex_matrix" to force jit.gl.texture to use the srd/dstdim attributes.
    • Mar 19 2012 | 5:38 pm
      thanks robert for looking at this.
      is there a example how to use the subtex_matrix attribute.
      my goal is to copy some scaled textures to an output texture
      (which has a fixed size)
      best,
      l.
    • May 08 2012 | 4:48 pm
      still having a problem with max6 using subtex_matrix of the jit.gl.texture object.
      the path, which is posted by hons does not work as expected in max6.
      perhaps someone can post a patch which demonstrates how the message "subtex_matrix" works and how we have to use the dstdimstart and dstdimend messages.
      thanks in advance,
      l.
    • May 08 2012 | 6:21 pm
      hons' patch is close, but it needs to use the subtex_matrix message to tell gl.texture to only copy a portion of the matrix (slight discrepancy with jit.matrix in this regard).
      here's a modified version:
    • May 09 2012 | 11:26 am
      hello robert,
      thanks for explaining how it works !
      perhaps it would be nice to put this somewhere in the documentation ;-)
      but i have still a problem, if i change the crop section, some portion of the texture "hangs".
      same behavior in max 5 and max 6
      here is a patch, which demonstrates the error.
    • May 09 2012 | 6:21 pm
      well, this isn't really an error. you are telling the texture to draw to only a portion of the rectangle, which it does.
      you need to "clear" the texture before sending the subtex_matrix message, perhaps by sending a black matrix to the texture.
    • May 10 2012 | 3:05 pm
      i think, the main misunderstanding in using dstdimstart and dstdimend is, that we need a named matrix as an input.
      i think hons and i thought, that we can crop a texture which the jit.gl.texture object. (which can be the output of an slab also )
      perhaps it would be a nice feature in the future.
      in the meantime we can use this crop shader:
      best,
      l.