How can i get a texture out of Jitter on the GPU?

Nov 20, 2007 at 2:45pm

How can i get a texture out of Jitter on the GPU?

How can i get a texture out of Jitter on the GPU?

I want to map a videotexture on a jit.gl.model with my fragmentshader. But how can i get a texture out of Jitter on the GPU? The uniform and varying parameters are no problem.

TNX

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 508 108 28 9109513 read;
#P toggle 445 87 15 0;
#P newex 445 108 55 9109513 metro 20;
#P newex 445 140 103 9109513 jit.qt.movie 256 256;
#P comment 461 89 149 9109513 • read a movie and start metro.;
#P user jit.pwindow 444 185 66 66 0 1 0 0 1 0;
#P newex 515 230 164 9109513 jit.gl.texture shctx @name mytexture;
#B color 5;
#P message 335 467 14 9109513 0;
#P message 297 468 29 9109513 -0.41;
#P message 270 469 14 9109513 0;
#P message 334 551 19 9109513 0;
#P message 302 550 14 9109513 0;
#P message 271 551 18 9109513 22;
#P flonum 320 494 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 279 496 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 243 516 91 9109513 pak position 0. 0. 0.;
#P flonum 243 491 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 313 579 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 275 579 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 239 599 108 9109513 pak rotatexyz 0. 0. 0.;
#P flonum 239 579 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 312 393 14 9109513 1;
#P message 288 392 14 9109513 1;
#P message 266 392 14 9109513 1;
#P flonum 317 417 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 279 417 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 243 437 81 9109513 pak scale 0. 0. 0.;
#P flonum 243 417 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 63 360 148 9109513 jit.gl.handle shctx @auto_rotate 1;
#P message 133 436 39 9109513 shader;
#P message 93 413 80 9109513 shader shademe;
#P newex 63 619 79 9109513 jit.gl.model shctx;
#B color 5;
#P window setfont “Fixedwidth Serif” 10.;
#P message 227 361 86 9240586 read pool.obj;
#P newex 305 883 39 9240586 print;
#P window setfont “Sans Serif” 9.;
#P message 124 783 59 9109513 read texl.jxs;
#P flonum 359 759 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 321 759 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 283 759 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 358 705 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 320 705 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 282 705 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 207 782 201 9109513 pak param coolcolor 0. 0. 0.6 1.;
#P newex 206 735 201 9109513 pak param warmcolor 0.6 0.7 0. 1.;
#P message 90 723 95 9109513 read mat.gooch.jxs;
#P message 66 699 120 9109513 read mat.dirperpixel.jxs;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 66 883 203 9240586 jit.gl.shader shctx @name shademe;
#P toggle 57 105 15 0;
#P user jit.pwindow 569 428 686 504 0 1 0 0 1 1;
#X name shctx;
#P message 570 400 203 9240586 name shctx , depthbuffer 1 , fsaa 1;
#P window setfont “Sans Serif” 12.;
#P comment 59 665 119 9109516 SHADER;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 57 177 62 9240586 t b erase;
#P window setfont “Proportional Serif” 10.;
#P comment 73 129 72 9175050 Start Rendering;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 57 153 62 9240586 qmetro 50;
#P newex 57 236 123 9240586 jit.gl.render shctx;
#P user panel 59 687 410 223;
#X brgb 195 209 218;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 58 351 344 294;
#X brgb 181 181 181;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 9 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 2 0;
#P fasten 5 1 2 0 114 201 62 201;
#P connect 36 0 24 0;
#P connect 40 0 24 0;
#P connect 29 0 24 0;
#P connect 23 0 24 0;
#P connect 26 0 24 0;
#P connect 25 0 24 0;
#P connect 27 0 24 0;
#P fasten 21 0 10 0 129 848 71 848;
#P fasten 13 0 10 0 211 762 71 762;
#P fasten 14 0 10 0 212 808 71 808;
#P fasten 12 0 10 0 95 758 71 758;
#P connect 11 0 10 0;
#P connect 32 0 29 1;
#P fasten 28 0 29 1 248 434 271 434;
#P connect 46 0 40 1;
#P fasten 39 0 40 1 248 513 275 513;
#P connect 43 0 36 1;
#P fasten 35 0 36 1 244 596 276 596;
#P connect 15 0 13 2;
#P connect 18 0 14 2;
#P connect 33 0 29 2;
#P fasten 30 0 29 2 284 434 294 434;
#P connect 47 0 40 2;
#P fasten 41 0 40 2 284 513 302 513;
#P connect 44 0 36 2;
#P fasten 37 0 36 2 280 596 308 596;
#P fasten 10 1 22 0 264 904 293 904 293 879 310 879;
#P connect 34 0 29 3;
#P fasten 31 0 29 3 322 434 317 434;
#P connect 16 0 13 3;
#P connect 19 0 14 3;
#P connect 48 0 40 3;
#P fasten 42 0 40 3 325 513 329 513;
#P connect 45 0 36 3;
#P fasten 38 0 36 3 318 596 340 596;
#P connect 17 0 13 4;
#P connect 20 0 14 4;
#P connect 54 0 53 0;
#P fasten 55 0 52 0 513 134 450 134;
#P fasten 53 0 52 0 450 134 450 134;
#P connect 52 0 50 0;
#P fasten 52 0 49 0 450 163 520 163;
#P connect 7 0 8 0;
#P pop;

#34684
Nov 20, 2007 at 5:16pm

I don’t really understand what you mean by “getting a texture “out of
jitter on the GPU”,
but if what you want is to get your texture mapped on your model, simply
send
a message “texture mytexture” to your GL object.
If you want to get it “back” from the GPU to jitter matrix, send “to_matrix
mymatrix”
to your jit.gl.texture object with a matrix named mymatrix.
hope this helps//

On Tue, 20 Nov 2007 07:45:40 -0700, peter

wrote:
> How can i get a texture out of Jitter on the GPU?
>
> I want to map a videotexture on a jit.gl.model with my fragmentshader.
But
> how can i get a texture out of Jitter on the GPU? The uniform and varying
> parameters are no problem.
>
> TNX
>
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P message 508 108 28 9109513 read;
> #P toggle 445 87 15 0;
> #P newex 445 108 55 9109513 metro 20;
> #P newex 445 140 103 9109513 jit.qt.movie 256 256;
> #P comment 461 89 149 9109513 • read a movie and start metro.;
> #P user jit.pwindow 444 185 66 66 0 1 0 0 1 0;
> #P newex 515 230 164 9109513 jit.gl.texture shctx @name mytexture;
> #B color 5;
> #P message 335 467 14 9109513 0;
> #P message 297 468 29 9109513 -0.41;
> #P message 270 469 14 9109513 0;
> #P message 334 551 19 9109513 0;
> #P message 302 550 14 9109513 0;
> #P message 271 551 18 9109513 22;
> #P flonum 320 494 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 279 496 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 243 516 91 9109513 pak position 0. 0. 0.;
> #P flonum 243 491 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 313 579 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 275 579 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 239 599 108 9109513 pak rotatexyz 0. 0. 0.;
> #P flonum 239 579 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 312 393 14 9109513 1;
> #P message 288 392 14 9109513 1;
> #P message 266 392 14 9109513 1;
> #P flonum 317 417 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 279 417 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 243 437 81 9109513 pak scale 0. 0. 0.;
> #P flonum 243 417 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 63 360 148 9109513 jit.gl.handle shctx @auto_rotate 1;
> #P message 133 436 39 9109513 shader;
> #P message 93 413 80 9109513 shader shademe;
> #P newex 63 619 79 9109513 jit.gl.model shctx;
> #B color 5;
> #P window setfont “Fixedwidth Serif” 10.;
> #P message 227 361 86 9240586 read pool.obj;
> #P newex 305 883 39 9240586 print;
> #P window setfont “Sans Serif” 9.;
> #P message 124 783 59 9109513 read texl.jxs;
> #P flonum 359 759 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 321 759 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 283 759 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 358 705 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 320 705 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 282 705 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 207 782 201 9109513 pak param coolcolor 0. 0. 0.6 1.;
> #P newex 206 735 201 9109513 pak param warmcolor 0.6 0.7 0. 1.;
> #P message 90 723 95 9109513 read mat.gooch.jxs;
> #P message 66 699 120 9109513 read mat.dirperpixel.jxs;
> #P window setfont “Fixedwidth Serif” 10.;
> #P newex 66 883 203 9240586 jit.gl.shader shctx @name shademe;
> #P toggle 57 105 15 0;
> #P user jit.pwindow 569 428 686 504 0 1 0 0 1 1;
> #X name shctx;
> #P message 570 400 203 9240586 name shctx , depthbuffer 1 , fsaa 1;
> #P window setfont “Sans Serif” 12.;
> #P comment 59 665 119 9109516 SHADER;
> #P window setfont “Fixedwidth Serif” 10.;
> #P newex 57 177 62 9240586 t b erase;
> #P window setfont “Proportional Serif” 10.;
> #P comment 73 129 72 9175050 Start Rendering;
> #P window setfont “Fixedwidth Serif” 10.;
> #P newex 57 153 62 9240586 qmetro 50;
> #P newex 57 236 123 9240586 jit.gl.render shctx;
> #P user panel 59 687 410 223;
> #X brgb 195 209 218;
> #X frgb 0 0 0;
> #X border 0;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P user panel 58 351 344 294;
> #X brgb 181 181 181;
> #X frgb 0 0 0;
> #X border 1;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P connect 9 0 3 0;
> #P connect 3 0 5 0;
> #P connect 5 0 2 0;
> #P fasten 5 1 2 0 114 201 62 201;
> #P connect 36 0 24 0;
> #P connect 40 0 24 0;
> #P connect 29 0 24 0;
> #P connect 23 0 24 0;
> #P connect 26 0 24 0;
> #P connect 25 0 24 0;
> #P connect 27 0 24 0;
> #P fasten 21 0 10 0 129 848 71 848;
> #P fasten 13 0 10 0 211 762 71 762;
> #P fasten 14 0 10 0 212 808 71 808;
> #P fasten 12 0 10 0 95 758 71 758;
> #P connect 11 0 10 0;
> #P connect 32 0 29 1;
> #P fasten 28 0 29 1 248 434 271 434;
> #P connect 46 0 40 1;
> #P fasten 39 0 40 1 248 513 275 513;
> #P connect 43 0 36 1;
> #P fasten 35 0 36 1 244 596 276 596;
> #P connect 15 0 13 2;
> #P connect 18 0 14 2;
> #P connect 33 0 29 2;
> #P fasten 30 0 29 2 284 434 294 434;
> #P connect 47 0 40 2;
> #P fasten 41 0 40 2 284 513 302 513;
> #P connect 44 0 36 2;
> #P fasten 37 0 36 2 280 596 308 596;
> #P fasten 10 1 22 0 264 904 293 904 293 879 310 879;
> #P connect 34 0 29 3;
> #P fasten 31 0 29 3 322 434 317 434;
> #P connect 16 0 13 3;
> #P connect 19 0 14 3;
> #P connect 48 0 40 3;
> #P fasten 42 0 40 3 325 513 329 513;
> #P connect 45 0 36 3;
> #P fasten 38 0 36 3 318 596 340 596;
> #P connect 17 0 13 4;
> #P connect 20 0 14 4;
> #P connect 54 0 53 0;
> #P fasten 55 0 52 0 513 134 450 134;
> #P fasten 53 0 52 0 450 134 450 134;
> #P connect 52 0 50 0;
> #P fasten 52 0 49 0 450 163 520 163;
> #P connect 7 0 8 0;
> #P pop;

#117447
Nov 20, 2007 at 6:11pm

i am a beginner in jitter but i can programm in CG so i need to load the video out of jitter into my fragment shader as a sampler2D. I tried to send
a message “texture mytexture” but it doesn`t work maybe because of a wrong jxs file definition.

#117448
Nov 20, 2007 at 6:39pm

Textures in jitter default to sampler2DRect

to make a square texture use a POT matrix (not mandatory but good
practice), and send it to a jit.gl.texture @name
@rectangle 0

Within your shader you have to use the jxs file format to bind the
textures to a texture unit. Within the JXS you specify your texture
variables as integer and default value as the texture unit index

You can then send to a openGL geometry object something like

shader , texture

and the texture should be bound to unit 1, and the shader should
reference it.

On Nov 20, 2007, at 1:11 PM, peter wrote:

>
> i am a beginner in jitter but i can programm in CG so i need to load
> the video out of jitter into my fragment shader as a sampler2D. I
> tried to send
> a message “texture mytexture” but it doesn`t work maybe because of
> a wrong jxs file definition.

#117449
Nov 20, 2007 at 6:50pm

Hi,
One thing about jit.gl.model you should know. When it loads a model
file and/or gets a texture message, it rebuilds the displaylist and
fixes any texture settings. So, if you attach a texture and try to
change say the mipmap filter types, it won’t register until you toggle
out of and back into the texture. This has been remedied for future
releases, but is something to be aware of in the current release.

wes

On 11/20/07, vade wrote:
> Textures in jitter default to sampler2DRect
>
> to make a square texture use a POT matrix (not mandatory but good
> practice), and send it to a jit.gl.texture @name
> @rectangle 0
>
> Within your shader you have to use the jxs file format to bind the
> textures to a texture unit. Within the JXS you specify your texture
> variables as integer and default value as the texture unit index
>
> You can then send to a openGL geometry object something like
>
>
> shader , texture
>
> and the texture should be bound to unit 1, and the shader should
> reference it.
>
>
>
> On Nov 20, 2007, at 1:11 PM, peter wrote:
>
> >
> > i am a beginner in jitter but i can programm in CG so i need to load
> > the video out of jitter into my fragment shader as a sampler2D. I
> > tried to send
> > a message “texture mytexture” but it doesn`t work maybe because of
> > a wrong jxs file definition.
>
>

#117450
Nov 20, 2007 at 7:29pm

in the jxs:

-> error: jit.gl.shader integer parameters not supported by CG

#117451
Nov 20, 2007 at 7:41pm

can you send the whole shader and a patch?

On Nov 20, 2007, at 2:29 PM, peter wrote:

>
> in the jxs:

>
> -> error: jit.gl.shader integer parameters not supported by CG

#117452
Nov 20, 2007 at 8:01pm

the patch and the shader.

#117453
Nov 20, 2007 at 8:29pm

What version of Jitter do you have? The CG texture binding was fixed
in a very recent version.
wes

On 11/20/07, peter

wrote:
> the patch and the shader.
>
>
>
>
>

#117454
Nov 20, 2007 at 8:39pm

Ok, im not a CG guy, I just know enough GLSL to seem like I know what
I am doing, so take this with a grain of salt:

First things I notice float4/float3 are not a valid params to pass for
type in a jxs file. You must use vec4 and vec3, same with arrays of
floats, which are matrices, should be described as mat4s in the JXS.

second your jit.gl.texture object does not have a context associated
to it.

perhaps that may help?

On Nov 20, 2007, at 3:01 PM, peter wrote:

> the patch and the shader.
>

#117455
Nov 20, 2007 at 8:43pm

id also check appendix c of the jitter docs, which describe the valid
parameters. Page 528.

The name of the datatype for the parameter values.
Valid types are: int, float, vec2-4, float2-4, mat2-4

On Nov 20, 2007, at 3:01 PM, peter wrote:

> the patch and the shader.
>

#117456
Nov 20, 2007 at 8:54pm

doh. I love how I quote text that contradicts what I said initially.
hahah. large grain of salt indeed!

On Nov 20, 2007, at 3:43 PM, vade wrote:

> id also check appendix c of the jitter docs, which describe the
> valid parameters. Page 528.
>
> The name of the datatype for the parameter values.
> Valid types are: int, float, vec2-4, float2-4, mat2-4
>
>
>
> On Nov 20, 2007, at 3:01 PM, peter wrote:
>
>> the patch and the shader.
>>
>

#117457
Nov 21, 2007 at 3:10am

Attached is a Phong shader using textures. The Jitter docs haven’t
been updated since cg texture support was added. The use is as
follows

wes

#117458
Nov 21, 2007 at 11:37am

sorry, but there is no shader attached

#117459
Nov 21, 2007 at 12:15pm

ok when i send a “bind” message to the jit.gl.texture it works an i can see the texture on the model. But now i get the error
-> GL error Stack overflow
so far so good

#117460
Nov 21, 2007 at 3:16pm

There is, but maybe not if you’re using the forum. Here’s an URL:
http://www.mat.ucsb.edu/~whsmith/mat.phong.cg.tex.jxs
wes

On 11/21/07, peter

wrote:
>
> sorry, but there is no shader attached
>

#117461

You must be logged in to reply to this topic.