Process the pixels from an openGL scene with GPU only ?

    Oct 07 2012 | 8:19 pm
    Hi there, I'm rendering very simple OpenGL context (only primitives multiplied with and matrices processed with jit.gen for position/scale of objects)
    rendering it to a jit.window, I'd like to add a light pixel processing stage just before the final output.
    Is there a smart/efficient way to do that without to many round trip from CPU/GPU ?
    I'm open to any discussions around this

    • Oct 08 2012 | 7:31 am
      Search here and on Max's examples folder for "render to texture". You capture the scene, process that texture with and attach it to a In Max 6, you could simplify the process with and instead of you could also use
      None of these techniques involve going back to the CPU.
    • Oct 08 2012 | 7:40 am
      okay got it. sometimes (often?) I'm a stupid theorist which is unable (especially in the morning...) to apply what he knows and you just pointed me here to the totally right thing, Pedro. Thanks for that.
      Ok about the fact it doesn't go back to the CPU.
    • Oct 08 2012 | 8:08 am
      works perfectly, of course.
    • Oct 08 2012 | 8:49 am
      trying now to switch on/off captures inside my messaging system.
      indeed, I have "many" small video generators with only one active at a time.
      because the texture rendering has to be included in all of them in order to make the final pixel processing stage, I need to capture only the one active... playing with that..
    • Oct 08 2012 | 9:47 am
      Here is the result
      I didn't find a better way to render from each snippet (one at a time) to global texture. The routing system is very cheap, and I'll consolidate it asap. But what I'm doing here when I want to trigger a particular snippet: - I send the message "drawto texture" to this particular videoplane - when i trig this latter, that one send a bang to all other snippets to trig the message "drawto a"
      a isn't related to anything in the patch and I guess it doesn't consume any gpu or cpu here (of course, I also not routing any qmetro bangs to any snippets except the current rendering one.
      is there a smarter way to disable the render to texture ?