Forums > Jitter

Doing distortion – nurbs?


January 3, 2007 | 1:16 am

Hi,
so I have done a (very simple and quite messy) patch for my show, using
jit.gl.sketch to generate 2d and 3d space, texturing a bit, colouring a
bit, scaling/rotating etc. and then out through jit.gl.render.

What I would like to do now is to start work on some wacky distortion
for the whole thing, slicing into the image, displacing some of it,
etc., doing the whole "digital corruption" thing, that all the kids are
into these days.
Can this be done within the GL framework? I was thinking some extreme
work with [matrixoutput 1] but does that work with jit.gl.sketch? It has
the output, but does it work? I haven’t been able to suss it…Maybe
some tricks with nurbs? Those can get pretty screwy – how about mapping
the whole GL output across a nurb as a texture or something?

To illustrate how far I’ve gotten:
I have managed to get a regular texture onto a nurb surface, just like
the texture help in the jit.gl.sketch helpfile, but never actually
managed to get GL out as matrix… :blushes a bit: (henceforth the
nurbs will be referred to as "the Throbbing IDM Donut".)

I am sorry if the answer is obvious, but it isn’t for me… obviously,
hehe. Pointers are most welcome, and virtual drinks are on me if I see
patch snippets.

Cheers – as always,
Yours,
Andreas.

January 3, 2007 | 1:34 am

You could use jit.gl.mesh and do some reordering of the texture
coordinates. There’s also the td.repos.jxs shader file for mucking
around with texture pixel positions.

wes

On 1/2/07, Andreas Wetterberg wrote:
> Hi,
> so I have done a (very simple and quite messy) patch for my show, using
> jit.gl.sketch to generate 2d and 3d space, texturing a bit, colouring a
> bit, scaling/rotating etc. and then out through jit.gl.render.
>
> What I would like to do now is to start work on some wacky distortion
> for the whole thing, slicing into the image, displacing some of it,
> etc., doing the whole "digital corruption" thing, that all the kids are
> into these days.
> Can this be done within the GL framework? I was thinking some extreme
> work with [matrixoutput 1] but does that work with jit.gl.sketch? It has
> the output, but does it work? I haven’t been able to suss it…Maybe
> some tricks with nurbs? Those can get pretty screwy – how about mapping
> the whole GL output across a nurb as a texture or something?
>
> To illustrate how far I’ve gotten:
> I have managed to get a regular texture onto a nurb surface, just like
> the texture help in the jit.gl.sketch helpfile, but never actually
> managed to get GL out as matrix… :blushes a bit: (henceforth the
> nurbs will be referred to as "the Throbbing IDM Donut".)
>
> I am sorry if the answer is obvious, but it isn’t for me… obviously,
> hehe. Pointers are most welcome, and virtual drinks are on me if I see
> patch snippets.
>
> Cheers – as always,
> Yours,
> Andreas.
>
>

January 3, 2007 | 1:43 am

Getting matrix out should be as simple as @matrix_output 1, however,
this will not output an image, but the vertex geometry of the actual
nurbs.

You would most likely be better off doing render to texture, or using
@capture to ‘capture the image’ the rendered (capture only works on
individual jitter objects, not the whole openGL context) object to a
texture – and then manipulate it as wesley mentioned, with slabs/
shaders/meshes or, readback to a matrix.

Ive got a patch that does glitch-alike -

http://abstrakt.vade.info/?p=48

you should be able to do some of this in openGL.

On Jan 2, 2007, at 8:16 PM, Andreas Wetterberg wrote:

> Hi,
> so I have done a (very simple and quite messy) patch for my show,
> using jit.gl.sketch to generate 2d and 3d space, texturing a bit,
> colouring a bit, scaling/rotating etc. and then out through
> jit.gl.render.
>
> What I would like to do now is to start work on some wacky
> distortion for the whole thing, slicing into the image, displacing
> some of it, etc., doing the whole "digital corruption" thing, that
> all the kids are into these days.
> Can this be done within the GL framework? I was thinking some
> extreme work with [matrixoutput 1] but does that work with
> jit.gl.sketch? It has the output, but does it work? I haven’t been
> able to suss it…Maybe some tricks with nurbs? Those can get
> pretty screwy – how about mapping the whole GL output across a nurb
> as a texture or something?
>
> To illustrate how far I’ve gotten:
> I have managed to get a regular texture onto a nurb surface, just
> like the texture help in the jit.gl.sketch helpfile, but never
> actually managed to get GL out as matrix… :blushes a bit:
> (henceforth the nurbs will be referred to as "the Throbbing IDM
> Donut".)
>
> I am sorry if the answer is obvious, but it isn’t for me…
> obviously, hehe. Pointers are most welcome, and virtual drinks are
> on me if I see patch snippets.
>
> Cheers – as always,
> Yours,
> Andreas.
>

v a d e //

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

January 3, 2007 | 2:18 am

January 3, 2007 | 2:31 am

January 3, 2007 | 2:35 am
January 3, 2007 | 2:55 am

This patch uses @capture with jit.gl.sketch to emulate ‘matrixoutput
1′ for jit.gl.sketch:

Hope this helps


On Jan 2, 2007, at 9:35 PM, Andreas Wetterberg wrote:

> vade skrev:
>> Getting matrix out should be as simple as @matrix_output 1,
>> however, this will not output an image, but the vertex geometry of
>> the actual nurbs.
> Which would be great, since I could then modify this data using
> regular jitter objects… but apparently this does not work with
> jit.gl.sketch. I would love some info on what the left-most output
> is for in this case.
>>
>> You would most likely be better off doing render to texture, or
>> using @capture to ‘capture the image’ the rendered (capture only
>> works on individual jitter objects, not the whole openGL context)
>> object to a texture – and then manipulate it as wesley mentioned,
>> with slabs/shaders/meshes or, readback to a matrix.
> This is where my knowledge runs out unfortunately… I’ve tried
> locating the @capture documentation unsuccesfully.
>>
>> Ive got a patch that does glitch-alike -
>>
>> http://abstrakt.vade.info/?p=48
>>
>> you should be able to do some of this in openGL.
> That’s exactly what I am hoping for.
>
> Andreas.
>>
>> On Jan 2, 2007, at 8:16 PM, Andreas Wetterberg wrote:
>>
>>> Hi,
>>> so I have done a (very simple and quite messy) patch for my show,
>>> using jit.gl.sketch to generate 2d and 3d space, texturing a bit,
>>> colouring a bit, scaling/rotating etc. and then out through
>>> jit.gl.render.
>>>
>>> What I would like to do now is to start work on some wacky
>>> distortion for the whole thing, slicing into the image,
>>> displacing some of it, etc., doing the whole "digital corruption"
>>> thing, that all the kids are into these days.
>>> Can this be done within the GL framework? I was thinking some
>>> extreme work with [matrixoutput 1] but does that work with
>>> jit.gl.sketch? It has the output, but does it work? I haven’t
>>> been able to suss it…Maybe some tricks with nurbs? Those can
>>> get pretty screwy – how about mapping the whole GL output across
>>> a nurb as a texture or something?
>>>
>>> To illustrate how far I’ve gotten:
>>> I have managed to get a regular texture onto a nurb surface, just
>>> like the texture help in the jit.gl.sketch helpfile, but never
>>> actually managed to get GL out as matrix… :blushes a bit:
>>> (henceforth the nurbs will be referred to as "the Throbbing IDM
>>> Donut".)
>>>
>>> I am sorry if the answer is obvious, but it isn’t for me…
>>> obviously, hehe. Pointers are most welcome, and virtual drinks
>>> are on me if I see patch snippets.
>>>
>>> Cheers – as always,
>>> Yours,
>>> Andreas.
>>>
>>
>> v a d e //
>>
>> http://www.vade.info
>> abstrakt.vade.info
>>
>>
>>
>>
>

v a d e //

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

January 3, 2007 | 3:01 am

January 3, 2007 | 3:20 am

I wasn’t able to find what the capabilities of that graphics card are.
Download the windows binary of GLEW from
http://glew.sourceforge.net/. Look in the glew/bin folder and run
glewinfo from a command line. You’re looking for this line:

GL_ARB_texture_rectangle: OK

If you’re unlucky, it will say MISSING instead of OK.

wes

January 3, 2007 | 3:21 am

vade skrev:
> This patch uses @capture with jit.gl.sketch to emulate ‘matrixoutput
> 1′ for jit.gl.sketch:
>
> Hope this helps
It does indeed! It clears up a lot of stuff for me, actually.
Particularly the fact that for this project, I’d better stay in GL. The
[dim 320 240] gives me a framerate of 11 or so, and the larger dimsize
brings Max to its knees… I think it’s about time I got myself a
dedicated Jitter machine! All of my woes seem to stem from crummy gfx
hardware… And to think that I actually got this dualcore 2ghz 2gigs of
ram machine because it was a great, but relatively cheap music machine,
and then I need to do video on it as well – oh, you can almost *taste*
the irony!

But I really really love your glitch tutorial – very nice stuff, and
definitely something to be explored in the future, when I’m back in
jit.matrix-country.
Andreas.

January 3, 2007 | 3:34 am

The slowness comes from the opengl -> matrix readback. If you remove
the jit.matrix after the jit.gl.texture (that is doing the readback,
note the patchcoord is blue (texture), then green (matrix). Jitter
has to pull data off of the GPU back to main memory, an operation
that is quite slow

if you map that texture to a videoplane with @transform_reset 2, im
sure you will see much improved framerates.

Glad it was of help.

On Jan 2, 2007, at 10:21 PM, Andreas Wetterberg wrote:

> vade skrev:
>> This patch uses @capture with jit.gl.sketch to emulate
>> ‘matrixoutput 1′ for jit.gl.sketch:
>>
>> Hope this helps
> It does indeed! It clears up a lot of stuff for me, actually.
> Particularly the fact that for this project, I’d better stay in GL.
> The [dim 320 240] gives me a framerate of 11 or so, and the larger
> dimsize brings Max to its knees… I think it’s about time I got
> myself a dedicated Jitter machine! All of my woes seem to stem from
> crummy gfx hardware… And to think that I actually got this
> dualcore 2ghz 2gigs of ram machine because it was a great, but
> relatively cheap music machine, and then I need to do video on it
> as well – oh, you can almost *taste* the irony!
>
> But I really really love your glitch tutorial – very nice stuff,
> and definitely something to be explored in the future, when I’m
> back in jit.matrix-country.
> Andreas.
>

v a d e //

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

January 3, 2007 | 3:48 am

Wesley Smith skrev:
> I wasn’t able to find what the capabilities of that graphics card are.
> Download the windows binary of GLEW from
> http://glew.sourceforge.net/. Look in the glew/bin folder and run
> glewinfo from a command line. You’re looking for this line:
>
> GL_ARB_texture_rectangle: OK
>
> If you’re unlucky, it will say MISSING instead of OK.

WOW! that was an eye-opener! Turns out there were more MISSING entries
in that list than there were okay. I’m only good until OpenGL v. 1.4

Thanks for your help, wes. I really appreciate it.
Andreas.

January 3, 2007 | 4:28 am

Should have been doing something else, like sleeping, but this was
far more interesting.

Here is a patch that makes gltiched looking texture coordinates for
use in openGL. This uses the same technique as before. It looks
pretty decent, not 100%, but it gets the idea. Never tried it before,
I like this, and its pretty fast

throw in another metro or whatever, a jit.slide and animate it….
could look cool.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 245 46 48 196617 loadbang;
#P user jit.pwindow 368 379 82 62 0 1 0 0 1 0;
#P newex 245 93 53 196617 t b b b b;
#P newex 678 254 212 196617 jit.tiffany @grid – @xrange 0.9 @yrange 0.9;
#P newex 369 358 74 196617 jit.op @op avg;
#P user jit.pwindow 821 142 82 62 0 1 0 0 1 0;
#P newex 803 118 100 196617 jit.noise 1 char 3 3;
#P newex 678 231 68 196617 jit.op @op < <;
#P user jit.pwindow 699 141 82 62 0 1 0 0 1 0;
#P user jit.pwindow 446 319 82 62 0 1 0 0 1 0;
#P user jit.pwindow 442 228 82 62 0 1 0 0 1 0;
#P comment 259 214 162 196617 move to origin 0. 0. 0;
#P newex 26 419 259 196617 jit.gl.handle test @auto_rotate 1
@inherit_transform 1;
#P newex 433 205 242 196617 jit.expr @expr "in[0]" "(dim[1]-cell[1])/
(dim[1])";
#P message 129 189 30 196617 read;
#P newex 678 118 112 196617 jit.noise 1 char 16 16;
#P newex 245 232 137 196617 jit.op @op – – pass @val 0.5;
#P button 245 70 15 0;
#P toggle 11 57 15 0;
#P newex 79 492 205 196617 jit.window test @depthbuffer 1 @floating 1;
#P newex 129 389 143 196617 jit.gl.mesh test @automatic 0;
#P newex 129 250 90 196617 jit.gl.texture test;
#P newex 129 213 63 196617 jit.qt.movie;
#P newex 369 293 160 196617 jit.repos @mode 0 @boundmode 4;
#P newex 35 142 40 196617 t b b b;
#P newex 11 109 58 196617 t b b erase;
#P newex 11 85 51 196617 qmetro 2;
#P newex 11 445 86 196617 jit.gl.render test;
#P newex 245 151 151 196617 jit.gencoord 3 float32 256 256;
#P comment 453 187 162 196617 normalize 0. 1 for texture coords;
#P fasten 23 0 22 1 808 207 741 207;
#P connect 23 0 24 0;
#P fasten 27 3 23 0 292 114 808 114;
#P connect 14 0 22 0;
#P connect 14 0 21 0;
#P connect 22 0 26 0;
#P fasten 27 2 14 0 278 114 683 114;
#P fasten 26 0 6 1 683 287 524 287;
#P connect 6 0 25 0;
#P fasten 6 0 20 0 374 315 452 315;
#P connect 16 0 6 0;
#P connect 16 0 25 1;
#P connect 16 0 19 0;
#P connect 1 0 13 0;
#P fasten 1 0 16 0 250 186 438 186;
#P fasten 25 0 9 1 374 378 150 378;
#P connect 25 0 28 0;
#P connect 27 0 1 0;
#P connect 12 0 27 0;
#P connect 29 0 12 0;
#P connect 8 0 9 0;
#P fasten 13 0 9 0 250 319 134 319;
#P fasten 5 1 9 0 55 272 134 272;
#P connect 7 0 8 0;
#P connect 15 0 7 0;
#P fasten 5 2 7 0 70 206 134 206;
#P connect 4 1 5 0;
#P fasten 4 2 2 0 64 134 16 134;
#P connect 4 0 2 0;
#P connect 17 0 2 0;
#P connect 3 0 4 0;
#P connect 11 0 3 0;
#P window clipboard copycount 30;

On Jan 2, 2007, at 10:48 PM, Andreas Wetterberg wrote:

> Wesley Smith skrev:
>> I wasn’t able to find what the capabilities of that graphics card
>> are.
>> Download the windows binary of GLEW from
>> http://glew.sourceforge.net/. Look in the glew/bin folder and run
>> glewinfo from a command line. You’re looking for this line:
>>
>> GL_ARB_texture_rectangle: OK
>>
>> If you’re unlucky, it will say MISSING instead of OK.
>
> WOW! that was an eye-opener! Turns out there were more MISSING
> entries in that list than there were okay. I’m only good until
> OpenGL v. 1.4
>
> Thanks for your help, wes. I really appreciate it.
> Andreas.

v a d e //

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

January 3, 2007 | 4:45 am

Erm, rather :

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 163 363 172 196617 jit.slide @slide_up 2 @slide_down 2;
#P newex 191 68 50 196617 qlim 100;
#P message 176 187 33 196617 start;
#P message 31 396 34 196617 reset;
#P newex 245 46 48 196617 loadbang;
#P user jit.pwindow 368 379 82 62 0 1 0 0 1 0;
#P newex 245 93 53 196617 t b b b b;
#P newex 678 254 212 196617 jit.tiffany @grid – @xrange 0.9 @yrange 0.9;
#P newex 369 326 74 196617 jit.op @op avg;
#P user jit.pwindow 821 142 82 62 0 1 0 0 1 0;
#P newex 803 118 100 196617 jit.noise 1 char 3 3;
#P newex 678 231 68 196617 jit.op @op < <;
#P user jit.pwindow 699 141 82 62 0 1 0 0 1 0;
#P user jit.pwindow 446 319 82 62 0 1 0 0 1 0;
#P user jit.pwindow 442 228 82 62 0 1 0 0 1 0;
#P comment 259 197 162 196617 move to origin 0. 0. 0;
#P newex 26 419 259 196617 jit.gl.handle test @auto_rotate 1
@inherit_transform 1;
#P newex 433 205 242 196617 jit.expr @expr "in[0]" "(dim[1]-cell[1])/
(dim[1])";
#P message 136 188 30 196617 read;
#P newex 678 118 97 196617 jit.noise 1 char 9 9;
#P newex 245 218 137 196617 jit.op @op – – pass @val 0.5;
#P button 245 70 15 0;
#P toggle 11 57 15 0;
#P newex 79 492 205 196617 jit.window test @depthbuffer 1 @floating 1;
#P newex 136 389 231 196617 jit.gl.mesh test @automatic 0 @scale
1.333 1. 1.;
#P newex 136 259 169 196617 jit.gl.texture test @flip 0 @adapt 1;
#P newex 136 212 107 196617 jit.qt.movie @adapt 1;
#P newex 369 293 160 196617 jit.repos @mode 0 @boundmode 4;
#P newex 35 142 40 196617 t b b b;
#P newex 11 109 58 196617 t b b erase;
#P newex 11 85 51 196617 qmetro 2;
#P newex 11 445 86 196617 jit.gl.render test;
#P newex 245 151 151 196617 jit.gencoord 2 float32 256 256;
#P comment 453 187 162 196617 normalize 0. 1 for texture coords;
#P fasten 23 0 22 1 808 207 741 207;
#P connect 23 0 24 0;
#P fasten 27 2 23 0 278 114 808 114;
#P connect 14 0 22 0;
#P connect 14 0 21 0;
#P connect 22 0 26 0;
#P fasten 27 1 14 0 264 114 683 114;
#P fasten 26 0 6 1 683 287 524 287;
#P connect 6 0 25 0;
#P fasten 6 0 20 0 374 315 452 315;
#P connect 16 0 6 0;
#P connect 16 0 25 1;
#P connect 16 0 19 0;
#P connect 1 0 13 0;
#P connect 1 0 16 0;
#P connect 25 0 33 0;
#P connect 25 0 28 0;
#P connect 27 0 1 0;
#P connect 32 0 27 0;
#P connect 12 0 27 0;
#P connect 29 0 12 0;
#P connect 5 0 32 0;
#P connect 33 0 9 1;
#P connect 8 0 9 0;
#P fasten 5 1 9 0 55 272 141 272;
#P fasten 13 0 9 0 250 312 141 312;
#P connect 7 0 8 0;
#P connect 31 0 7 0;
#P connect 15 0 7 0;
#P fasten 5 2 7 0 70 206 141 206;
#P connect 4 1 5 0;
#P connect 30 0 17 0;
#P connect 17 0 2 0;
#P connect 4 0 2 0;
#P fasten 4 2 2 0 64 134 16 134;
#P connect 3 0 4 0;
#P connect 11 0 3 0;
#P window clipboard copycount 34;

v a d e //

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

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

Forums > Jitter