Forums > Jitter

stained glass

March 13, 2008 | 11:24 am

Hello
I can not find a technique for isolating, analysing and

processing part af a matrix, which would be NOT

rectangular. The idea is to make a sort of stained

glass, which would change it’s shape. I’d like to

control this changes, let’s say they should not be

random.
It seems to be rather heavy task for CPU, but I hardly

imagine this effect in Open GL.
In fact there are 2 tasks:
1st – draw this stained glass shape.
2nd – process picture or movie "under"it – to apply

color and transparency variations according to areas on

"upper" surface.
Would anybody advise?


March 13, 2008 | 3:10 pm

Hi, i had similar ideas for a piece.
i would use two layers for the same source : the top one with non rectangular holes using noise genrators on the alpha channel and applying shaders on the lower one. lots of fun stuff to do with it.

here is a short example that shows you the process, hoping it helps :

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 735 311 63 196617 loadmess 0.;
#P flonum 238 241 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 238 263 78 196617 scale $1 $1 $1;
#P flonum 877 368 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 877 387 72 196617 brightness $1;
#P flonum 810 368 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 810 387 63 196617 contrast $1;
#P flonum 735 368 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 735 387 71 196617 saturation $1;
#P newex 735 410 76 196617 prepend param;
#P newex 655 442 174 196617 jit.gl.slab noWar @file cc.brcosa.jxs;
#P newex 315 352 75 196617 loadmess 0.98;
#P flonum 159 243 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 131 263 99 196617 pak rotation 0. 0. 0.;
#P user jit.pwindow 4 287 82 62 0 0 0 0 0 0;
#P flonum 315 376 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 315 398 50 196617 width $1;
#P newex 314 416 76 196617 prepend param;
#P newex 396 443 195 196617 jit.gl.slab noWar @file cf.gaussian.2p.jxs;
#P newex 396 239 269 196617 t l l;
#P window linecount 2;
#P newex 655 519 245 196617 jit.gl.videoplane noWar @automatic 0 @blend_enable 1 @transform_reset 2 @depth_enable 1;
#P window linecount 1;
#P newex 20 103 227 196617 jit.gl.render noWar @erase_color 0.2 0.2 0.2 1.;
#P newex 20 76 133 196617 t b b erase;
#P newex 20 50 51 196617 qmetro 2;
#P newex 94 309 129 196617 jit.matrix 1 char 320 240;
#P newex 95 288 293 196617 jit.bfg 1 float32 320 240 @basis noise.simplex @scale 3. 3. 3.;
#P message 396 163 30 196617 open;
#P newex 396 327 53 196617 jit.pack;
#P newex 396 263 66 196617 jit.unpack;
#P newex 396 219 56 196617 jit.qt.grab;
#P newex 397 583 160 196617 jit.window noWar @size 640 480;
#P window linecount 2;
#P newex 396 519 245 196617 jit.gl.videoplane noWar @automatic 0 @blend_enable 1 @transform_reset 2 @depth_enable 1;
#P window linecount 1;
#P newex 81 159 53 196617 t b b b b;
#P toggle 21 29 15 0;
#P comment 160 224 100 196617 play with these;
#P connect 34 0 27 0;
#P connect 33 0 32 0;
#P fasten 32 0 9 0 243 283 100 283;
#P fasten 2 2 14 0 114 395 660 395;
#P connect 24 0 14 0;
#P connect 16 0 3 0;
#P connect 7 0 16 0;
#P fasten 25 0 24 0 740 433 660 433;
#P connect 15 1 24 0;
#P connect 27 0 26 0;
#P fasten 26 0 25 0 740 406 740 406;
#P fasten 30 0 25 0 882 406 740 406;
#P fasten 28 0 25 0 815 406 740 406;
#P connect 29 0 28 0;
#P connect 31 0 30 0;
#P connect 9 0 20 0;
#P connect 9 0 10 0;
#P fasten 21 0 9 0 136 284 100 284;
#P connect 2 1 9 0;
#P connect 12 1 2 0;
#P fasten 2 3 5 0 128 197 401 197;
#P fasten 17 0 16 0 319 435 401 435;
#P fasten 2 0 3 0 86 444 401 444;
#P connect 12 0 13 0;
#P fasten 12 2 13 0 147 98 25 98;
#P connect 23 0 19 0;
#P connect 22 0 21 1;
#P connect 18 0 17 0;
#P connect 19 0 18 0;
#P connect 15 0 6 0;
#P connect 5 0 15 0;
#P connect 1 0 11 0;
#P connect 11 0 12 0;
#P connect 8 0 5 0;
#P connect 10 0 7 0;
#P connect 6 1 7 1;
#P connect 6 2 7 2;
#P connect 6 3 7 3;
#P window clipboard copycount 35;

Quote: Onandoff wrote on Thu, 13 March 2008 12:24
—————————————————-
> Hello
> I can not find a technique for isolating, analysing and
>
> processing part af a matrix, which would be NOT
>
> rectangular. The idea is to make a sort of stained
>
> glass, which would change it’s shape. I’d like to
>
> control this changes, let’s say they should not be
>
> random.
> It seems to be rather heavy task for CPU, but I hardly
>
> imagine this effect in Open GL.
> In fact there are 2 tasks:
> 1st – draw this stained glass shape.
> 2nd – process picture or movie "under"it – to apply
>
> color and transparency variations according to areas on
>
> "upper" surface.
> Would anybody advise?
—————————————————-


March 14, 2008 | 8:57 am

Hello Karrrlo
Thanks for the suggestion. I have some troubles with shadres – probably my videocard is old, or there is some dofference

between Mac and Windows shaders files. Strange, but brcosa almost does not work. I found that "mask" shapes would be more

interesting if bfg would be 3 dimensional (320 240 1).
But in fact with this patch I miss 2 things:
1. I can not control separate isoloted areas of "low" matrix. Let’s say – the effect is applyed to the whole matrix.
2. still shapes look more or less as spots, but I’ve been thinking about those small fragments in stain glass (Notre Dame

windows…), even with borders.

Well. I think I should work on matrix analyser-reporter (sort of eye dropper + magic wand in Photoshop)

Thanks for drawing me to shaders and slabs – I have to try them more
Alex


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