I have done a little work on gemframebuffer recently. I added a message for changing the background color and also uncommented some of the glMatrix() code. It is close to rendering properly but has the following problems:
- OSX only works with exact powers of two for size - separator doesn't work in chains following gemframebuffer - all geos are textured with the contents of gemframebuffer
I'm kind of slow when it comes to correctly setting and unsetting the glMatrix calls, so that is probably where the problem lies. It seems trickier with basically having a completely different rendering target inside of another one too.
Testing patch attached.
chris clepper wrote:
I have done a little work on gemframebuffer recently. I added a message for changing the background color and also uncommented some of the glMatrix() code. It is close to rendering properly but has the following problems:
cool, i want mirrors!
- OSX only works with exact powers of two for size
true for linux too.
- separator doesn't work in chains following gemframebuffer
it does work, but in your example patch the left subchain is rendered _before_ the right ([separator]ed) subchain, that's why the [separator] does not have any effect. either use [separator]s for _all_ subchains, or use [t a a] (it's like in pd ;-))
- all geos are textured with the contents of gemframebuffer
it does work, but you have to glDisable() things you have glEnable()d ;-)
Testing patch attached.
i attached a "fixed" version.
mf.asdr IOhannes
#N canvas 86 112 834 822 10; #X obj 98 47 gemhead 20; #X obj 93 87 gemframebuffer; #X obj 421 115 gemhead; #X obj 441 190 pix_multitexture 1; #X msg 174 158 texUnit 0 $1; #X obj 172 111 unpack 0 0 0 0; #X obj 262 139 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 256 256; #X obj 305 137 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 3553 256; #X obj 174 139 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1 256; #X obj 219 139 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 256 256; #X obj 441 168 GEMglEnable; #X floatatom 482 311 5 0 0 0 - - -; #X floatatom 431 312 5 0 0 0 - - -; #X obj 531 309 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X msg 122 67 dim 320 240; #X msg 159 26 dim 256 256; #X obj 156 553 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 94 551 cube 0.1; #X obj 299 520 rotateXYZ; #X floatatom 349 503 5 0 0 0 - - -; #X floatatom 370 522 5 0 0 0 - - -; #X floatatom 307 503 5 0 0 0 - - -; #X floatatom 190 393 5 0 0 0 - - -; #X floatatom 239 393 5 0 0 0 - - -; #X floatatom 141 393 5 0 0 0 - - -; #X obj 298 217 separator; #X obj 548 27 gemhead 1; #X obj 548 47 world_light; #X obj 94 417 translateXYZ -0.5 -0.8 -1; #X msg 246 37 dim 512 512; #X obj 352 453 f; #X obj 376 452 + 1; #X obj 361 477 mod 360; #X obj 564 182 gemwin; #X msg 567 154 create , 1; #X msg 554 122 destroy; #X obj 441 277 rotateXYZ; #X floatatom 457 242 5 0 0 0 - - -; #X floatatom 496 239 5 0 0 0 - - -; #X msg 0 87 color 0 0 1 0; #X msg 238 73 dim 1024 1024; #X msg -6 109 color 0 0 0 0; #X obj 94 477 rotateXYZ; #X floatatom 117 443 5 0 0 0 - - -; #X floatatom 160 440 5 0 0 0 - - -; #X floatatom 209 446 5 0 0 0 - - -; #X msg 564 235 dimen 640 480; #X msg 632 121 color 0 0 0 0; #X obj 313 610 sphere; #X obj 299 435 t a b; #X msg 13 39 type FLOAT; #X obj 441 428 cube 1; #X msg 612 94 color 0 1 1 0; #X obj 366 539 color 1 0 0; #X floatatom 328 371 5 0 0 0 - - -; #X obj 441 330 translateXYZ 0 0 2.9; #X obj 541 471 gemhead; #X obj 549 581 world_light; #X msg 452 87 lighting $1; #X obj 467 56 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X floatatom 487 393 5 0 0 0 - - -; #X obj 93 189 t a a; #X floatatom 380 377 5 0 0 0 - - -; #X obj 296 406 translateXYZ -5 -2 0; #X floatatom 362 596 5 0 0 0 - - -; #X msg 217 535 draw $1; #X symbolatom 216 504 10 0 0 0 - - -; #X obj 93 255 color 1 1 1; #X obj 94 313 pix_texture; #X obj 93 294 pix_image ../examples/data/fractal.JPG; #X obj 713 453 gemhead; #X obj 712 568 teapot; #X obj 411 141 t a a; #X obj 329 167 GEMglDisable; #X connect 0 0 1 0; #X connect 1 0 61 0; #X connect 1 1 5 0; #X connect 2 0 72 0; #X connect 3 0 36 0; #X connect 4 0 3 0; #X connect 5 0 8 0; #X connect 5 1 9 0; #X connect 5 2 6 0; #X connect 5 3 7 0; #X connect 7 0 10 1; #X connect 7 0 73 1; #X connect 8 0 4 0; #X connect 10 0 3 0; #X connect 11 0 55 2; #X connect 12 0 55 1; #X connect 13 0 55 3; #X connect 14 0 1 0; #X connect 15 0 1 0; #X connect 16 0 17 1; #X connect 18 0 53 0; #X connect 19 0 18 2; #X connect 20 0 18 3; #X connect 21 0 18 1; #X connect 22 0 28 2; #X connect 23 0 28 3; #X connect 24 0 28 1; #X connect 25 0 63 0; #X connect 26 0 27 0; #X connect 28 0 42 0; #X connect 29 0 1 0; #X connect 30 0 31 0; #X connect 31 0 30 1; #X connect 31 0 32 0; #X connect 32 0 19 0; #X connect 34 0 33 0; #X connect 35 0 33 0; #X connect 36 0 55 0; #X connect 37 0 36 1; #X connect 38 0 36 3; #X connect 39 0 1 0; #X connect 40 0 1 0; #X connect 41 0 1 0; #X connect 42 0 17 0; #X connect 43 0 42 1; #X connect 44 0 42 2; #X connect 45 0 42 3; #X connect 46 0 33 0; #X connect 47 0 33 0; #X connect 49 0 18 0; #X connect 49 1 30 0; #X connect 50 0 1 0; #X connect 52 0 33 0; #X connect 53 0 48 0; #X connect 54 0 63 1; #X connect 55 0 51 0; #X connect 56 0 57 0; #X connect 58 0 33 0; #X connect 59 0 58 0; #X connect 60 0 51 1; #X connect 61 0 67 0; #X connect 61 1 25 0; #X connect 62 0 63 2; #X connect 63 0 49 0; #X connect 64 0 48 1; #X connect 65 0 17 0; #X connect 65 0 48 0; #X connect 66 0 65 0; #X connect 67 0 69 0; #X connect 68 0 28 0; #X connect 69 0 68 0; #X connect 70 0 71 0; #X connect 72 0 73 0; #X connect 72 1 10 0;
On 9/20/06, IOhannes m zmoelnig zmoelnig@iem.at wrote:
- separator doesn't work in chains following gemframebuffer
it does work, but in your example patch the left subchain is rendered _before_ the right ([separator]ed) subchain, that's why the [separator] does not have any effect. either use [separator]s for _all_ subchains, or use [t a a] (it's like in pd ;-))
I caught that after sending it.
- all geos are textured with the contents of gemframebuffer
it does work, but you have to glDisable() things you have glEnable()d ;-)
That is part of the the multitexture that I don't get. Would it not be better to pass that directly to pix_multitexture rather than have a fake postrender glDisable()?
Testing patch attached.
i attached a "fixed" version.
Thanks.
It looks like the glFrustum call in gemframebuffer is messing up the matrices. Resize the example patch to 640x480 to see it happen. I think it is too late to reset the frustum in postrender() so each gemhead after is wrong. Maybe each gemhead has to set it using the GemMan settings? There might be another solution as well.
Setting the viewport and frustum in gemhead does seem to work. However, I think this would require pretty extensive testing since it changes an essential rendering object.
I will be gone until next Tuesday which would be a good time for someone to come up with an alternative solution.
On 9/20/06, chris clepper cgclepper@gmail.com wrote:
It looks like the glFrustum call in gemframebuffer is messing up the matrices. Resize the example patch to 640x480 to see it happen. I think it is too late to reset the frustum in postrender() so each gemhead after is wrong. Maybe each gemhead has to set it using the GemMan settings? There might be another solution as well.