GL Feedback


    Jan 24 2006 | 11:17 pm
    Hi Jitter-fans, Here's a simple demo patch that shows how to set up the to_texture message to perform feedback processing with a gl context. I've included 2 textures, one for using fullscreen mode, and then the other for using the 640 480 window. This technique of switching textures allows for resizing the jit.window without getting those error messages. With a little ingenuity, you can be kicking out some swirly 3-D psychedelic visuals in no time.
    Have fun, and Happy Patching! Cheers, Andrew B.

    • Jan 24 2006 | 11:19 pm
      And here it is for reals:
    • Jan 25 2006 | 8:32 am
      hi andrew,
      thanks for the clear gl_feedback_example! the texture switching method is exactly what i needed.
      cheers,
      jan
    • Jan 25 2006 | 11:36 am
      Wow.
      So much food for thought. I will come back with more questions later today ;-)
      Thank you!
      pa
    • Jan 25 2006 | 12:04 pm
      Hi Andrew, I'm only getting these errors:
      jit.gl.render: building GL on window "foo"... warning: method screen_grab called on invalid object warning: method screen_grab called on invalid object warning: method screen_grab called on invalid object ... ... etc.
      winmax 4.5.6 jitter 1.5.2
      Thijs
    • Jan 25 2006 | 12:17 pm
      hoi thijs,
      the 'usetexture dst' message box needs to be sent to the render befor you start the feedback. best achieved by putting a 'loadbang 0' to the fullscreen togglebox..
      grtn,
      jan
    • Jan 25 2006 | 12:27 pm
      Ah thanks!
      t_
    • Jan 25 2006 | 1:18 pm
      > best achieved by putting a 'loadbang 0' to the fullscreen togglebox..
      i meant 'loadmess 0' of course. i should really stop typing emails with my nose;.)
      > > Ah thanks!
      you're welcome!
      jan
    • Jan 25 2006 | 3:29 pm
      Dear Andrew, Wesley and all
      If I understand well, to_texture can only be used to do whole scene feedback. The capture to texture is working fine so far. I have one more question:
      Wesley, what do you mean when you say:
      > Personally, I like to render to a pbuffer.
      I have looked on the web for pbuffer and can't figure out what you are talking about.
      pa
      nb It seems that the getparamlist message to jit.gl.slab does not output anything...
    • Jan 25 2006 | 4:13 pm
      Here's a glossary of graphics card terms: http://www.gpgpu.org/w/index.php/Glossary#FBO . After looking at this page, I learned a new one: FBO . Seems to be the best place to get a render to texture now-a-days.
      > nb It seems that the getparamlist message to jit.gl.slab does not > output anything...
      The best way to figure out what params a shader has is to open the file in a text editor (I prefer Text Wrangler on OSX). It's easier to see there than as a list in the maxwindow.
      wes
    • Jan 25 2006 | 4:36 pm
      Thanks so much
      pa
    • Jan 25 2006 | 4:40 pm
      Wesley.
      Can I shamefully ask for a small sample code of pbuffering? It all sounds great, I understand the concept, but to see a real example will help me to deduce more usage of the openGL book started today and ways to apply that in jitter.
      Thanks
      pa
    • Jan 25 2006 | 4:53 pm
      As I'm sure you've discovered, it's used alot in the computer gaphics literature for multipass rendering. If you can get your hands on GPU Gems 2 from your local library I think you'll find the pages 541-543 decently descriptive as it also has code sinppets. (I'm not sure, but NeHe might have something about this as well...in any case it's a great resource for opengl manips).
      wes
    • Jan 25 2006 | 6:32 pm
    • Jan 27 2006 | 8:29 am
      I have read the book chapter but I still find no connection on using pbuffer in Max/Jitter environment....
      Wesley, could you help to give a bit more hint on utilizing pbuffer ? Should we use jit.gl.sketch or we have to write our own (or find) an external to work on it ?
      by the way, in my days of experiementing with rendering to texture, I have encountered an error message saids "jit.gl.pbuffer: error updating bound texture: GL Error: Stack overflow". I wonder if there is an implicit object named jit.gl.pbuffer but I have found no entry of documentation about it...
      ps: Thanks to Andrew for your patch. I have made the "to_texture" working now, but seems it only work on the display buffer while my application need to a capture from an offscreen buffer (e.g. render to texture from camera A and render scene in camera B with the captured texture)
      (^_^) William
    • Jan 27 2006 | 3:10 pm
      I don;t have the book in front of me right now, but let me see if I can remember. It went a little something like this:
      Rendering to a pbuffer in the traditional fashion requires a new opengl context to be set up. This causes massive overhead a slow applications. Using the opengl aux buffers liek AUX0 etc gets you the same effect but without the context switches. On the aforementioned pages, there was code as to how to set this up. Unfortunately, to do this in jitter right now, you're gogin to have to write your own external as far as I know.
      best, wes
    • Jan 27 2006 | 3:28 pm
      this isn't working for me at all. when i switch to fullscreen, i get the grid texture on the vidplane and the max window fills with
      jit.gl.texture: error entering unbind: GL Error: Invalid value jit.gl.texture: error entering unbind: GL Error: Invalid value jit.gl.texture: error entering unbind: GL Error: Invalid value jit.gl.texture: error entering unbind: GL Error: Invalid value jit.gl.texture: error entering unbind: GL Error: Invalid value jit.gl.texture: error entering unbind: GL Error: Invalid value jit.gl.texture: error entering unbind: GL Error: Invalid value
      os x 10.4.4, albook 1.67 feb 05, newest m/m/j.
    • Jan 27 2006 | 3:33 pm
      You have to muck with the textures a bit to get it to work. I too had the same errors but was eventually able to get it to work.
      wes
    • Jan 27 2006 | 4:05 pm
      how? what did you have to do?
    • Jan 27 2006 | 4:13 pm
      I believe I never used the fst texture, just the dst texture. I also messed with the texture dims. I don't remember the specific settings, but that's what I messed with. Also, when you go fullscreen, the context is rebuilt, so you may have to reregister the texture names by clicking on the appropriate messages.
      wes
    • Jan 27 2006 | 7:24 pm
      this is the sort of thing that just makes me feel like an idiot w/r/t the gl stuff. i get weird errors and random crashes, and when i report them i get the digital equivalent of blank stares.
      wes, can you post a version of this that actually does work? TIA.
    • Feb 09 2006 | 5:23 am
      thanks andrew. the dual texture concept saved the day for a readback thing I needed. my head was getting sore bc. i was trying to change dims on the texture, which, for whatever reason, it did NOT like.
      peter.