gl.aysncread help

    Jan 04 2013 | 2:05 pm
    I'm working on a performance patch for a university project. I've currently trying to mix between two patches - one which does a simple crossfade between two images, the other uses to perform a number of manipulations and distortions to an image on a plane. The problem I'm having is I'm using gl.asyncread to convert from the gl plane back into data which I can easily mix with my crossfade patch, it doesn't look very good, it totally degrades the output of the image from the WTW-wobble patch. I think this is stemming from gl.asyncread as it looks great when I view it through jit.window. I've included all three patches - Thunderstorm is the main control interface and WTW-wobble is the patch i'm having trouble with. I hope theres a simple solution for this problem. Thanks

    • Jan 04 2013 | 2:47 pm
      Check the dim and size attributes of the objects in your patch. I bet one of 'm is defaulting to 320x240 resolution. Perhaps asyncread itself is the culprit.
    • Jan 04 2013 | 3:02 pm
      You're right. The asyncread objects destination dim is set to 320x240. I've tried changing it to 1200x800 but it keeps reverting to 320x240 any ideas why?
    • Jan 04 2013 | 4:43 pm
      It gets the same resolution as the render context, which is the window size. You can get around this by rendering to a matrix directly, if you don't really need the window. There's just been another thread on this:
    • Jan 04 2013 | 6:39 pm
      Thanks. I've gone through the thread and have tried changing the drawto in the patch so as to send it to a matrix but haven't been successful. I've tried resizing the jit.window and this sorts out the low quality issue, just leaves me with a massive window in the background- so it would be useful if i could get rid of this too and just have it rendering to a matrix.
    • Jan 04 2013 | 7:07 pm
      why do you want to read back your gl image into a matrix? it will be much more efficient and give you many more options if you instead send your matrix to your GL context and do the mixing there.
      you really want to go in one directions (matrix to GL) and keep things in GL for the final display output, unless you have a specific reason not to do that.
      in the patch below i've demonstrated how you can achieve the same thing as your patch, without using asyncread. you want to draw your geometry using, instead of the older gl.render messages.
      you can then use to capture this geometry to a texture (this replaced the gl.asyncread in your patch) and @gen xfade to crossfade this texture with another matrix.