gl model to gl.slab (gpu rendering)

Jul 1, 2006 at 2:29pm

gl model to gl.slab (gpu rendering)

I tried to build a patch in which the jit.gl.model/render will be the input to the jit.gl.slab. In other words: capture the image of the 3D model and use slab for some shader effects on top of it. The thing is that I want to avoid jit.gl.sketch with jit.matrix to grab the 3d image because of the software rendering (am I right?). The idea is to stay in gl (or to render on the gpu) for high performance.

Any ideas?

Here is an example of the patch with its workflow.

max v2;
#N vpatcher 15 55 615 455;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 73 133 48 9109513 ?;
#B color 5;
#P newex 72 248 89 9109513 jit.gl.videoplane out;
#P newex 73 101 54 9109513 jit.gl.render;
#P newex 72 283 63 9109513 jit.window out;
#P newex 72 214 61 9109513 jit.gl.slab out;
#B color 5;
#P newex 73 69 53 9109513 jit.gl.model;
#B color 5;
#P comment 72 37 284 9109513 opengl model to jit.gl.slab as 2D image without using jit.matrix;
#P window linecount 5;
#P comment 142 133 128 9109513 use hardware rendering for higher framerate avoiding jit.matrix which uses software rendering;
#P fasten 3 0 6 0 77 241 77 241;
#P pop;

#26657
Jul 1, 2006 at 4:31pm

Hi Ranja

here is a patch that uses @capture to render to a large texture
(using dest_dim on the model and @dim on the target texture), and
automatic 0 (which is a good habit to get into when doing GL), as
well as some slab processing on the texture. Id tune the dest_dim and
dim to your video card (I get 60 fps without any slab processing and
30 if I use td.sinefold.jxs on the 1024×768 texture.

hope this helps.

max v2;
#N vpatcher 10 59 872 611;
#P window setfont “Sans Serif” 9.;
#P message 258 290 43 196617 dispose;
#P user jit.fpsgui 48 384 60 196617 0;
#P flonum 553 284 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 553 310 80 196617 param phase $1;
#P flonum 723 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 681 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 639 309 111 196617 pak param center 0. 0.;
#P flonum 773 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 478 284 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 478 310 73 196617 param amp $1;
#P message 773 310 78 196617 param damp $1;
#P flonum 396 284 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 396 310 75 196617 param freq $1;
#P message 265 310 95 196617 read td.sinefold.jxs;
#P message 415 86 34 196617 reset;
#P newex 415 118 325 196617 jit.gl.handle capture @visible 0
@inherit_transform 0 @auto_rotate 1;
#P newex 77 149 223 196617 t b b b b;
#P toggle 45 50 15 0;
#P newex 46 79 51 196617 qmetro 2;
#P newex 46 110 58 196617 t b b erase;
#P newex 48 362 102 196617 jit.gl.render capture;
#P message 319 151 30 196617 read;
#P window linecount 3;
#P newex 290 194 315 196617 jit.gl.model capture @lighting_enable 1
@depth_enable 1 @smooth_shading 1 @blend_enable 1 @capture
capture_destination @automatic 0 @antialias 1 @dest_dim 1024 768;
#P window linecount 1;
#P newex 246 379 355 196617 jit.gl.videoplane capture @scale 1.3333
1. 1. @automatic 0 @depth_enable 0;
#P newex 246 340 154 196617 jit.gl.slab capture @automatic 0;
#P window linecount 2;
#P newex 246 249 232 196617 jit.gl.texture capture @name
capture_destination @automatic 0 @adapt 1 @dim 1024 768;
#P window linecount 1;
#P newex 174 485 167 196617 jit.window capture @depthbuffer 1;
#P connect 9 0 8 0;
#P connect 8 0 7 0;
#P connect 7 0 6 0;
#P connect 7 2 6 0;
#P connect 6 0 25 0;
#P connect 7 1 10 0;
#P connect 10 2 1 0;
#P fasten 26 0 2 0 263 322 251 322;
#P fasten 16 0 2 0 778 332 251 332;
#P fasten 20 0 2 0 644 332 251 332;
#P fasten 17 0 2 0 483 332 251 332;
#P fasten 14 0 2 0 401 332 251 332;
#P fasten 13 0 2 0 270 332 251 332;
#P connect 1 0 2 0;
#P connect 10 1 2 0;
#P connect 2 0 3 0;
#P connect 10 0 3 0;
#P connect 11 0 4 0;
#P connect 10 3 4 0;
#P connect 5 0 4 0;
#P connect 15 0 14 0;
#P connect 12 0 11 0;
#P connect 18 0 17 0;
#P connect 24 0 23 0;
#P connect 21 0 20 2;
#P connect 22 0 20 3;
#P connect 19 0 16 0;
#P pop;

v a d e //

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

#79994

You must be logged in to reply to this topic.