Switch or crossfade between two different OpenGL renderings

    Jan 28 2013 | 10:51 pm
    Sorry for the newbie question - this feels like it should be really simple, but I cannot for the life of me figure out how to do it! I want to be able to switch or crossfade between two different OpenGL renderings into the same window. I suppose I could render them both to a matrix and switch/crossfade those, but that's CPU inefficient. Perhaps there is a way to do it with slabs or textures?

    • Jan 28 2013 | 10:58 pm
      take a look at jit.gl.node. this is one of the things it was built for. you will want to enable the @capture attribute, and you can xfade using slabs, or better yet, jit.gl.pix.
    • Jan 29 2013 | 6:03 am
      Thank you! Unfortunately I'm still using Max 5! I wonder if there's some workaround...
    • Jan 29 2013 | 7:36 pm
      you can do this in max 5 using the to_texture message to jit.gl.render. search the forum for this message, and i'm sure you'll find some examples.
    • Jan 31 2013 | 12:42 am
      Thanks again! I didn't find a way to do it using to_texture, at least not one that I could understand or get to work, but I did find a post showing how to switch between scenes using the @capture attribute of jit.gl.sketch. One point I had been missing was setting @automatic 0 on gl objects, otherwise they tend to get automatically drawn in the wrong place.
      Not sure if this is the best way of doing things but it seems to work pretty well. Patch posted for future reference: