Problems rendering GL to a matrix
I have several patches which render a GL context to a jit.window with great results. I wanted to change the output of one of my patchers to a jit.matrix (mainly so I can jit.qt.record it). I am running into problems, error messages thrown like the following:
jit.gl.texture: setting texture wrap mode t: GL Error: Invalid enumeration
jit.gl.readback: unable to create framebuffer: pbuffers not supported!!
jit.gl.shader: graphics hardware is not capable of running CG vertex programs.
jit.gl.shader: graphics hardware is not capable of running CG fragment programs.
jit.gl.shader: CG not supported for current hardware config.
jit.gl.shader: unable to load program!
jit.gl.shader: unable to find usable language implementation.
jit.gl.shader: error loading shader!
jit.gl: invalid extension called
I know that the messages about graphics hardware are not accurate because the exact same patch on the exact same hardware rendering to a jit.window (or jit.pwindow) instead of a jit.matrix works flawlessly.
I have boiled this down to a much simpler patch to demonstrate what I’m seeing. Any help would be appreciated.
I also found that you can crash Max if you delete the jit.window object while rendering.
----------begin_max5_patcher---------- 1835.3ocyasrbaaCEcsyL4e.QqZmQkCwC9pqbmtpKxl1tqIiGHQHY5PQvPBE a2L8euW.PJIKaQQJQHkjLhjfj.Wbtm6So782+talLS9jndB5WQ+C5la9NLxM lwzibS6.2LYE+o447ZyCNYtb0JQgZxzlapDOoL2f4g987r4eAotOqFMasRIK PYEvkBTIuVIRgCp42KpP7hTzi5yM2TTUIqPqD007khZzh7m+vlYegrPUvWIL qvuUkwy2dqpkyrhtuGymlPHSgyv9Iw9L8YQ93jP7TD1yG841WJK0LSxYO7Kj fWrGlKykUCd9JqD0.ZvUYxh6pDyU1YHJ1yeJhFp+zu4isuTw5UYE4BkAPw6t Uqy9WyVECKxNOsbsp8w2LrAKyJVt6pFXVUp4yHyAbhdgMux+892oOBGld9Ja pG5uD4vJi344S0pwBz5hZ6PZk5CYJuGyJRkOhTRyH4hEJfhHKe1n+MTB883n BwisTilopRrR9Mg409jFiKEEoeZh9omWI3v6wMKvJtpJ6IDnM0K6LQt7QuMx ZdVgXtbcgQfoCjP4GvR7MD.RDKvp06fJwNLUpGyzAHQDhg5vBStrzHBgry5R hiL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dQxwZm6K ZtXDqu4c5H8zJgpRBkILzDhbdv838cBX68tiSQ+PvDuzzc7EqyyqmKJFpyfP mWKCwOzVimInWRfi6Y8gvouZ4S3gZdiSbNgp0VCGtgREhuhTJEZFRIay7.tP TwqGbTF7nvrXGA2ZCznyopMPCFGL.eWa2o5qZG0tkcWhq1Fo2DAxrX2YBA.w HZ92fKEjPcdfccs3aBsS2FsfzqRAGinEGLO1Wlt7o0UWh669MM1xMaL48Cuh 4O910OsIRB51zrUmXRQDxEnsDI1VAYCuDP9wolp83hmZrYF08MpHJbW5nscr WO5XcNeVCWLqnbspFQP2tHKWfjkd7zTuGdpdffXj+n.hjiaSSrestDr+HwDs ut4aSc+emcFoPei8.a6WGayZzxgP6HHohZUVg4GQxNOkFjP3sO08YoohhW7M atJKsTlUnZjjt3.8V3LNb6oz4e4kNlaDN8utNcIfIlN6SSXatZbD6v9H159F OLwNzJ1T6WfMyOxKZSSgwikrG4FYOJz24xtNg2csgdaYO75PkS5CtZ1AWAgq Wx1UQznNQzhhMV7wIMAaiZqgINYr3h8QtY+.SEeUjgiKc3XqaUa2XZcqpu5B J26Gtcnhc.jJwnJ1A8BsSFdv.sXlX6RgcGjfunh7YIwQip.i6k4Fldcr25kO rfefkM7fcTEZLhBRZ++xPyEiWXd5QiILXkMIJYafflexC93WNz3sAHNXCvht Lafdke6IH+XCqgPh1WzMCMNXe+H7Wo5ch6kvc9IIpG.N7+TqUEgC -----------end_max5_patcher-----------
Thanks for the patch. I can reproduce and will look into it.
After poking around in the examples, I found another way to tee the render output.
examples/jitter-examples/render/render/jit.gl.render-tomatrix.maxpat shows 3 methods, including the most recommended method of using a jit.gl.sketch on the same context and hooking it up to dump its pixels to another context by sending it a glreadpixels message.
I built this into my patch, but the cost of banging the jit.gl.sketch seems to be quite high.
Normally, my patch gets about 35 FPS, but banging a jit.gl.sketch which glreadpixels to a 320×240 matrix knocks it back to around 25 FPS. If I make the matrix 720×480, then I only get 11-12 FPS. I can jit.qt.record that matrix at around that rate by recording to a RAM disk (if I record to a file on a hard drive, the frame rate goes even lower – 8-9 FPS).
Is there a cheaper way to do this?
My goal is to get to DV output (720×480 @ 29.97 FPS) but it seems like HD should be attainable as well in this modern age.
There was a similar question recently and I posted a patch using
On Fri, Oct 31, 2008 at 10:48 PM, James Drage
> After poking around in the examples, I found another way to tee the render
> examples/jitter-examples/render/render/jit.gl.render-tomatrix.maxpat shows
> 3 methods, including the most recommended method of using a jit.gl.sketch on
> the same context and hooking it up to dump its pixels to another context by
> sending it a glreadpixels message.
> I built this into my patch, but the cost of banging the jit.gl.sketch seems
> to be quite high.
> Normally, my patch gets about 35 FPS, but banging a jit.gl.sketch which
> glreadpixels to a 320×240 matrix knocks it back to around 25 FPS. If I make
> the matrix 720×480, then I only get 11-12 FPS. I can jit.qt.record that
> matrix at around that rate by recording to a RAM disk (if I record to a file
> on a hard drive, the frame rate goes even lower – 8-9 FPS).
> Is there a cheaper way to do this?
> My goal is to get to DV output (720×480 @ 29.97 FPS) but it seems like HD
> should be attainable as well in this modern age.
> Any tips?
Thanks for the response Pelado. I tried the patch at the bottom of the thread on your link, and I get a little over 3 fps.
I also tried integrating the jit.gl.asyncread method into my patcher, and I get similar results, around 3 fps with a 720×480 matrix. If I do a 320×240 matrix it comes out around 11 fps. So this is even slower than using the jit.gl.sketch method.
Did some debugging here, and as soon as I send "automatic 1" to the jit.gl.asyncread, the frame rate drops through the floor. I get 35 fps with "automatic 0" (of course, I don’t get anything in the matrix). So it seems that the bottleneck is indeed pulling the read to the matrix.
It seems like that should be a lot higher. Any idea why it’s so slow?
Objects like jit.gl.asyncread depend greatly on your GPU. What do you have?
It’s an HIS Radeon X1550. Driver version 8.421.0.0.
I’ve got another machine with an eVGA GeForce 6200 LE in it. I’ll try the same patch and see what kind of results I get.
Well sheesh. I get close to 30 fps even recording 720×480 to the hard drive with the NVidia-based card. That’s much more palatable!
Thanks for the quick response!
Can you post a basic patch? I have a machine with an x1600 I can test with.
On Sun, Nov 2, 2008 at 8:38 PM, James Drage
> It’s an HIS Radeon X1550. Driver version 8.421.0.0.
> I’ve got another machine with an eVGA GeForce 6200 LE in it. I’ll try the same patch and see what kind of results I get.