GL Feedback
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.
And here it is for reals:
hi andrew,
thanks for the clear gl_feedback_example!
the texture switching method is exactly what i needed.
cheers,
jan
Wow.
So much food for thought. I will come back with more questions later
today ;-)
Thank you!
pa
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
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
Ah thanks!
t_
> 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
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...
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
Thanks so much
pa
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
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
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
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
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.
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
how? what did you have to do?
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
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.
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.