Forums > Jitter

capturing and lighting ..

June 4, 2007 | 9:46 am

Hello ..

Is there a way to capture an object to a texture ..so that it keeps the lighting parameters of the scene .Any messages to the jit.gl.texture that is used to capture.? Any message to the jit.gl.sketch obj that is used to light the scene ? ..

Thanks a lot for any help

Pascal

Ex :

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 555 566 144 196617 jit.gl.sketch foo @pushstate 0;
#P window setfont "Sans Serif" 12.;
#P window linecount 4;
#P message 555 491 362 196620 reset , glenable lighting , glenable normalize , glenable light1 , gllightmodel ambient 0. 0. 0. 1. , gllight light1 ambient 0. 0. 0. 1. , gllight light1 specular 0. 0. 0. 1. , gllight light1 diffuse 1. 0. 0. 1. , gllight light1 position 0. 0. 2. 1. , bang;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 660 128 81 196617 prepend capture;
#P user ubumenu 660 102 72 196617 0 1 1 0;
#X add none;
#X add cap;
#X add tex;
#X add none;
#X add cap;
#X add tex;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P newex 575 129 81 196617 prepend texture;
#P user ubumenu 575 103 72 196617 0 1 1 0;
#X add none;
#X add tex;
#X add cap;
#X add none;
#X add tex;
#X add cap;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 497 130 71 196617 prepend shape;
#P user ubumenu 497 104 72 196617 0 1 1 0;
#X add sphere;
#X add torus;
#X add cylinder;
#X add opencylinder;
#X add cube;
#X add opencube;
#X add plane;
#X add circle;
#X prefix_set 0 0
0;
#P number 431 104 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 431 132 54 196617 dim $1 $1;
#P newex 431 169 93 196617 jit.gl.gridshape foo;
#B color 5;
#P newex 340 133 81 196617 prepend capture;
#P user ubumenu 340 107 72 196617 0 1 1 0;
#X add none;
#X add cap;
#X add tex;
#X add none;
#X add cap;
#X add tex;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 253 131 81 196617 prepend texture;
#P user ubumenu 253 105 72 196617 0 1 1 0;
#X add none;
#X add tex;
#X add cap;
#X add none;
#X add tex;
#X add cap;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 833 272 200 196617 jit.gl.texture foo @name cap @mode static;
#B color 5;
#P user ubumenu 850 195 100 196617 0 1 1 0;
#X add auto;
#X add alpha;
#X add luminance;
#X add intensity;
#X add depth;
#X add lumalpha;
#X add rgb;
#X add argb;
#X add uyvy;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 857 220 93 196617 prepend colormode;
#P message 826 126 28 196617 read;
#P message 857 126 31 196617 start;
#P toggle 763 105 15 0;
#P newex 763 126 55 196617 metro 20;
#P newex 763 158 103 196617 jit.qt.movie 256 256;
#P comment 779 107 149 196617 ? read a movie and start metro.;
#P user jit.pwindow 762 203 66 66 0 1 0 0 1 0;
#P newex 833 248 200 196617 jit.gl.texture foo @name tex @mode static;
#B color 5;
#P window setfont "Sans Serif" 18.;
#P comment 15 7 286 196626 capture to a texture;
#P toggle 241 449 15 0;
#P window setfont "Sans Serif" 9.;
#P message 241 467 55 196617 floating $1;
#P toggle 238 312 15 0;
#P window linecount 0;
#P comment 271 284 100 196617;
#P window linecount 1;
#P message 119 535 105 196617 light_position 1 1 1 0;
#P hidden message 48 410 68 196617 camera 0 0 4;
#P newex 171 131 71 196617 prepend shape;
#P user ubumenu 171 105 72 196617 0 1 1 0;
#X add sphere;
#X add torus;
#X add cylinder;
#X add opencylinder;
#X add cube;
#X add opencube;
#X add plane;
#X add circle;
#X prefix_set 0 0
0;
#P flonum 726 294 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 688 294 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 648 294 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 623 321 85 196617 pak scale 1. 1. 1.;
#P newex 183 158 208 196617 jit.gl.handle foo @depth_enable 1 @radius 2.;
#P toggle 168 449 15 0;
#P newex 129 448 35 196617 sel 27;
#P message 168 467 68 196617 fullscreen $1;
#P newex 86 491 145 196617 jit.window foo @depthbuffer 1;
#P newex 84 448 40 196617 key;
#P window linecount 3;
#P comment 168 61 369 196617 use the capture method bind a texture as a target to store the contents of the framebuffer after a 3d object has been rendered. this texture can then be bound to another 3d object as a surface texture in the usual manner;
#P number 107 103 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 107 131 54 196617 dim $1 $1;
#P newex 120 166 43 196617 r grimy;
#P user jit.fpsgui 59 256 60 196617 0;
#P newex 188 395 43 196617 s grimy;
#P flonum 745 342 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 707 342 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 667 342 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 559 368 64 196617 shininess $1;
#P flonum 559 345 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 365 345 15 0;
#P message 365 368 94 196617 smooth_shading $1;
#P message 91 371 79 196617 color 0. 1. 0. 1.;
#P toggle 464 345 15 0;
#P message 464 368 90 196617 lighting_enable $1;
#P newex 15 151 43 196617 jit.qball;
#P toggle 42 350 15 0;
#P message 42 371 44 196617 axes $1;
#P toggle 258 349 15 0;
#P toggle 217 348 15 0;
#P newex 176 369 92 196617 pak poly_mode 0 0;
#P hidden newex 404 302 50 196617 loadbang;
#P number 60 102 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 277 345 15 0;
#P message 277 368 81 196617 depth_enable $1;
#P toggle 15 102 15 0;
#P newex 15 128 55 196617 metro 20;
#P newex 15 182 55 196617 t b erase b;
#P newex 171 191 93 196617 jit.gl.gridshape foo;
#B color 5;
#P newex 15 582 80 196617 jit.gl.render foo;
#P hidden message 405 324 14 196617 1;
#P newex 639 366 95 196617 pak position 0. 0. 0.;
#P connect 76 0 77 0;
#P connect 61 1 60 0;
#P fasten 60 0 52 0 862 240 838 240;
#P fasten 55 0 52 0 768 181 838 181;
#P connect 55 0 53 0;
#P fasten 58 0 55 0 862 152 768 152;
#P fasten 59 0 55 0 831 152 768 152;
#P fasten 56 0 55 0 768 152 768 152;
#P connect 57 0 56 0;
#P fasten 26 0 0 3 750 361 728 361;
#P fasten 42 0 39 3 731 315 703 315;
#P fasten 25 0 0 2 712 361 700 361;
#P fasten 41 0 39 2 693 315 678 315;
#P connect 24 0 0 1;
#P fasten 74 1 75 0 696 123 665 123;
#P connect 40 0 39 1;
#P fasten 72 1 73 0 611 124 580 124;
#P connect 22 0 23 0;
#P fasten 70 1 71 0 533 125 502 125;
#P connect 18 0 17 0;
#P hidden fasten 1 0 8 0 410 342 282 342;
#P hidden fasten 1 0 21 0 410 342 370 342;
#P hidden fasten 1 0 18 0 410 342 469 342;
#P connect 68 0 67 0;
#P connect 71 0 67 0;
#P fasten 75 0 67 0 665 168 436 168;
#P fasten 73 0 67 0 580 167 436 167;
#P connect 69 0 68 0;
#P hidden connect 10 0 45 0;
#P hidden connect 10 0 1 0;
#P connect 21 0 20 0;
#P fasten 65 1 66 0 376 128 345 128;
#P connect 8 0 7 0;
#P connect 13 0 11 2;
#P fasten 48 0 12 0 243 337 222 337;
#P fasten 48 0 13 0 243 338 263 338;
#P fasten 63 1 64 0 289 126 258 126;
#P connect 50 0 49 0;
#P connect 12 0 11 1;
#P fasten 0 0 27 0 644 390 193 390;
#P fasten 14 0 27 0 47 392 193 392;
#P fasten 23 0 27 0 564 390 193 390;
#P fasten 17 0 27 0 469 390 193 390;
#P fasten 20 0 27 0 370 390 193 390;
#P fasten 19 0 27 0 96 392 193 392;
#P fasten 11 0 27 0 181 392 193 392;
#P fasten 7 0 27 0 282 390 193 390;
#P fasten 39 0 27 0 628 390 193 390;
#P fasten 66 0 3 0 345 150 176 150;
#P fasten 64 0 3 0 258 150 176 150;
#P fasten 38 0 3 0 188 183 176 183;
#P fasten 29 0 3 0 125 193 176 193;
#P connect 44 0 3 0;
#P fasten 30 0 3 0 112 149 176 149;
#P fasten 43 1 44 0 207 126 176 126;
#P connect 37 0 35 0;
#P fasten 36 0 37 0 134 466 165 466 165 446 173 446;
#P fasten 33 0 36 0 89 467 126 467 126 446 134 446;
#P connect 31 0 30 0;
#P fasten 49 0 34 0 246 486 91 486;
#P fasten 35 0 34 0 173 486 91 486;
#P connect 9 0 5 1;
#P connect 4 2 28 0;
#P connect 15 0 14 0;
#P fasten 3 0 2 0 176 292 20 292;
#P fasten 4 1 2 0 42 210 20 210;
#P connect 4 0 2 0;
#P hidden fasten 45 0 2 0 53 503 20 503;
#P fasten 46 0 2 0 124 566 20 566;
#P fasten 67 0 2 0 436 293 20 293;
#P connect 16 0 4 0;
#P connect 5 0 16 0;
#P connect 6 0 5 0;
#P window clipboard copycount 78;


June 4, 2007 | 3:50 pm

works here

#P window setfont "Sans Serif" 9.;
#P flonum 532 268 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 510 251 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 488 269 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 466 251 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 442 295 137 196617 pak mat_specular 1. 1. 1. 1.;
#P flonum 390 269 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 368 252 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 346 270 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 324 252 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 302 298 134 196617 pak mat_ambient 1. 1. 1. 1.;
#P window linecount 3;
#P comment 730 307 81 196617 turn OFF auto_material to use shininess.;
#P window linecount 1;
#P newex 10 315 192 196617 jit.gl.handle v001 @inherit_transform 1;
#P newex 241 431 161 196617 jit.gl.texture v001 @name target;
#P newex 227 571 269 196617 jit.gl.videoplane v001 @transform_reset 2
@automatic 0;
#P window linecount 3;
#P newex 262 335 312 196617 jit.gl.gridshape v001 @automatic 0
@capture target @lighting_enable 1 @blend_enable 1 @depth_enable 1
@blend_mode 6 7 @smooth_shading 1 @shape sphere @auto_material 0;
#P window linecount 1;
#P newex 227 270 40 196617 t b b b;
#P toggle 72 161 15 0;
#P newex 72 187 51 196617 qmetro 2;
#P newex 72 225 58 196617 t b b erase;
#P newex 135 714 157 196617 jit.window v001 @depthbuffer 1;
#P newex 72 378 92 196617 jit.gl.render v001;
#P connect 5 2 6 0;
#P connect 11 0 6 0;
#P connect 16 0 6 0;
#P connect 20 0 16 4;
#P connect 19 0 16 3;
#P connect 18 0 16 2;
#P connect 17 0 16 1;
#P connect 15 0 11 4;
#P connect 14 0 11 3;
#P connect 13 0 11 2;
#P connect 12 0 11 1;
#P connect 8 0 7 0;
#P connect 5 0 7 0;
#P connect 9 0 0 0;
#P connect 5 1 8 0;
#P fasten 2 1 5 0 101 256 232 256;
#P connect 2 0 0 0;
#P connect 2 2 0 0;
#P connect 3 0 2 0;
#P connect 4 0 3 0;
#P window clipboard copycount 21;

v a d e //

http://www.vade.info
abstrakt.vade.info


Viewing 2 posts - 1 through 2 (of 2 total)