Forums > Jitter

Question about Model and texture behavior in matrixoutput 1 vs 0

May 19, 2007 | 11:47 pm

hello.

I have a model that has specific texture coordinates. When I output
to matrix, it seems as though my texture coordinates are lost and the
texture projection is different than with matrixoutput 0.

what do I have to do to maintain the models specific texture
coordinates when sending out geometry as a matrix?

(I am using xfade to morph geometry, but not sending to jit.gl.mesh,
simply appending triangles and sending to jit.gl.render).

Curious.. :)

v a d e //

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


May 20, 2007 | 12:45 am

On May 19, 2007, at 4:47 PM, vade wrote:

> what do I have to do to maintain the models specific texture
> coordinates when sending out geometry as a matrix?

Coordinates are fine, but the texture is not bound properly, unless
you bind the texture through jit.gl.render. For example with your
poser file, I use something like the following in conjunction with
body_df.jpg, and it seems to work as I would expect. Otherwise, send
us a clear example of you binding the texture outside jit.gl.model
(required for textures as applied via matrix output mode to work
properly AFAICT), and hopefully we can offer some feedback.

We can look at making this work easier in a future version, but it
probably won’t happen anytime before Max 5 is released.

Best,
Joshua

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 604 606 62 196617 s to_render;
#P newex 604 550 88 196617 jit.gl.texture mdl;
#P message 604 488 55 196617 read , bang;
#P newex 604 508 107 196617 jit.qt.movie @adapt 1;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 1 0 0 0;
#P window clipboard copycount 4;


May 20, 2007 | 1:10 am

Ah. Thank you sir. I will experiment and report back. I did not
realize I had to bind the texture separately, thats probably it.
Thanks again for all the help lately :)
On May 19, 2007, at 8:45 PM, Joshua Kit Clayton wrote:

>
> On May 19, 2007, at 4:47 PM, vade wrote:
>
>> what do I have to do to maintain the models specific texture
>> coordinates when sending out geometry as a matrix?
>
> Coordinates are fine, but the texture is not bound properly, unless
> you bind the texture through jit.gl.render. For example with your
> poser file, I use something like the following in conjunction with
> body_df.jpg, and it seems to work as I would expect. Otherwise,
> send us a clear example of you binding the texture outside
> jit.gl.model (required for textures as applied via matrix output
> mode to work properly AFAICT), and hopefully we can offer some
> feedback.
>
> We can look at making this work easier in a future version, but it
> probably won’t happen anytime before Max 5 is released.
>
> Best,
> Joshua
>
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 604 606 62 196617 s to_render;
> #P newex 604 550 88 196617 jit.gl.texture mdl;
> #P message 604 488 55 196617 read , bang;
> #P newex 604 508 107 196617 jit.qt.movie @adapt 1;
> #P connect 0 0 2 0;
> #P connect 2 0 3 0;
> #P connect 1 0 0 0;
> #P window clipboard copycount 4;

v a d e //

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



VG
May 23, 2007 | 9:27 am

hi Joshua, Vade, other Jitter experts..

… just trying to get feedback to a previous unanswered post,
that I thought would maybe be related to what was told in this last
thread…

I’m capturing the result of the render to a texture, to apply it on
another GL object, somehow as shown in the patch "GLfeedBack" from
Andrew’s jitter recipes.The problem is that my window size is 3840×1024
(with the amazing triplehead) that is not a power of 2. So I get a
"chess" rectangle on the right side of the texture which has no
continuity when set on "repeat" mode. I guess there should be a way to
extend the capture texture to the next power of 2, or at least to
interpolate the texture to a size interger of two (as the GPU may not be
able to handle 4096 x 1024 texture size)

This was tested with a PC with NVIDIA GeForce 7900 GTX.

Note that the problem doesn’t look same on my powerbook G4 -PPC:
if i set the jit.gl.texture to "rectangle 1", I have some kind of repeat
wrap mode but the repetition look very strange (see screenshot attached)
Though, I know it is mentionned in jitter documentation that this option
may give strange results..

It seems the message "rectangle" sent to the jit.gl.texture is making
the texture use only the relevant part of the texture as stored on the GPU,
(though I don’t know truly what it does) , anyway it is not possible to
have "repeat" wrap mode on the jit.gl.texture if reactangle is 1.

I put a simple patch below to show the problem, drawn from Andrew
Benson’s "GL feedback" example
Thanks for any hint!

…vincent

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 856 207 80 196617 read dozer.mov;
#P flonum 203 308 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 240 308 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 166 308 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 129 325 98 196617 pak scale 0. 0. -0.4;
#P number 1053 194 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 1055 212 64 196617 tex_map $1;
#P message 634 90 67 196617 rectangle $1;
#P toggle 634 69 15 0;
#P flonum 1120 123 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1069 123 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1034 150 100 196617 pak anchor 0.5 0.5;
#N vpatcher 204 440 687 786;
#P window setfont "Sans Serif" 9.;
#P newex 98 79 60 196617 unpack 0. 0.;
#P newex 32 47 123 196617 route theta zoom anchor;
#P newex 353 98 27 196617 t b l;
#P flonum 32 127 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 190 219 27 196617 * 1.;
#P newex 370 178 41 196617 * -1.;
#P newex 227 219 27 196617 * 1.;
#P newex 32 219 27 196617 * 1.;
#P newex 370 123 60 196617 unpack 0. 0.;
#P newex 353 76 79 196617 vexpr 1./$f1;
#P newex 69 219 41 196617 * -1.;
#P newex 32 149 100 196617 expr 0.5*cos($f1);
#P newex 209 149 97 196617 expr 0.5*sin($f1);
#P flonum 301 244 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 264 244 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 227 244 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 190 244 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 191 267 147 196617 pak tex_plane_t 0. 0.5 0. 0.5;
#P flonum 143 245 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 106 245 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 69 245 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 32 245 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 33 267 149 196617 pak tex_plane_s 0.5 0. 0. 0.5;
#P inlet 32 25 15 0;
#P outlet 33 297 15 0;
#P connect 1 0 23 0;
#P fasten 22 0 21 0 358 122 37 122;
#P connect 23 0 21 0;
#P connect 21 0 13 0;
#P connect 13 0 17 0;
#P connect 17 0 3 0;
#P connect 2 0 0 0;
#P fasten 7 0 0 0 196 291 38 291;
#P fasten 16 0 17 1 375 171 54 171;
#P fasten 3 0 2 1 37 263 72 263;
#P fasten 12 0 14 0 214 182 74 182;
#P connect 14 0 4 0;
#P connect 23 2 24 0;
#P fasten 19 0 14 1 375 208 91 208;
#P fasten 4 0 2 2 74 263 106 263;
#P fasten 5 0 2 3 111 263 140 263;
#P fasten 24 0 6 0 103 104 148 104;
#P fasten 6 0 2 4 148 263 174 263;
#P fasten 12 0 20 0 214 182 195 182;
#P connect 20 0 8 0;
#P fasten 16 1 20 1 425 213 212 213;
#P fasten 21 0 12 0 37 145 214 145;
#P fasten 8 0 7 1 195 263 230 263;
#P fasten 13 0 18 0 37 193 232 193;
#P connect 18 0 9 0;
#P fasten 16 1 18 1 425 213 249 213;
#P fasten 9 0 7 2 232 263 264 263;
#P fasten 10 0 7 3 269 263 298 263;
#P fasten 24 1 11 0 153 108 306 108;
#P fasten 11 0 7 4 306 263 332 263;
#P fasten 23 1 15 0 70 71 358 71;
#P connect 15 0 22 0;
#P connect 22 1 16 0;
#P connect 16 0 19 0;
#P pop;
#P newobj 846 180 94 196617 p TexCoordMagic;
#P message 854 153 56 196617 theta $1;
#P newex 854 128 107 196617 expr $f1*3.14/180;
#P flonum 970 104 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1007 128 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 970 128 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 940 151 70 196617 pak zoom 1. 1.;
#P flonum 854 108 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 957 269 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 994 269 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 920 269 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 883 286 98 196617 pak scale 0. 0. -0.4;
#P newex 534 220 30 196617 t b b;
#P user ubumenu 652 152 100 196617 0 1 1 0;
#X add clamp;
#X add repeat;
#X add clampedge;
#X add clampborder;
#X add mirroredrepeat;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P newex 659 177 70 196617 prepend wrap;
#P message 383 262 29 196617 stop;
#P message 421 263 80 196617 read dozer.mov;
#P newex 343 281 146 196617 jit.qt.movie @colormode uyvy;
#B color 5;
#P user jit.fpsgui 46 284 60 196617 0;
#P newex 254 79 48 196617 loadbang;
#P comment 694 209 91 196617 window texture;
#P flonum 806 267 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 843 267 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 769 267 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 732 284 121 196617 pak position 0. 0. -0.4;
#P newex 460 77 40 196617 key;
#P message 436 123 70 196617 fullscreen $1;
#P toggle 436 102 15 0;
#P newex 460 97 38 196617 sel 27;
#P message 651 266 34 196617 reset;
#P window linecount 2;
#P newex 299 309 297 196617 jit.gl.videoplane foo @automatic 0 @scale
1.1 0.82 1. @color 1. 1. 1. 0.3 @blend_enable 1 @blend_mode 6 1
@colormode uyvy;
#P window linecount 1;
#P newex 651 284 80 196617 jit.gl.handle foo;
#P window linecount 2;
#P newex 642 311 353 196617 jit.gl.gridshape foo @shape plane @automatic
0 @scale 1.2 0.9 1. @color 1. 1 1 0.7 @blend_enable 1 @blend_mode 6 1
@position 0. 0. -0.4 @tex_map 1;
#P window linecount 1;
#P message 254 143 76 196617 usetexture dst;
#P newex 642 234 206 196617 jit.gl.texture foo @name dst @dim 640 480;
#P toggle 46 83 15 0;
#P newex 436 142 146 196617 jit.window foo @size 640 480;
#P newex 46 255 231 196617 jit.gl.render foo @erase_color 0.07 0.07 0.05 1.;
#P newex 46 128 154 196617 t b b erase to_texture b b erase;
#P newex 46 104 51 196617 qmetro 5;
#P window setfont "Sans Serif" 24.;
#P comment 47 27 765 196632 GL Feedback : how to repeat non power of 2
sized textures ?;
#P connect 43 0 41 2;
#P connect 42 0 41 1;
#P connect 47 0 46 0;
#P connect 37 0 35 0;
#P fasten 37 0 36 0 975 123 1012 123;
#P fasten 36 0 34 2 1012 147 1005 147;
#P connect 31 0 29 3;
#P connect 35 0 34 1;
#P connect 32 0 29 2;
#P connect 30 0 29 1;
#P connect 38 0 39 0;
#P connect 33 0 38 0;
#P connect 39 0 40 0;
#P fasten 34 0 40 0 945 176 851 176;
#P fasten 41 0 40 0 1039 175 851 175;
#P connect 18 0 16 3;
#P connect 19 0 16 2;
#P connect 17 0 16 1;
#P fasten 27 1 26 0 702 172 664 172;
#P connect 11 0 9 0;
#P connect 40 0 8 0;
#P connect 6 0 8 0;
#P fasten 29 0 8 0 888 307 647 307;
#P connect 28 0 8 0;
#P fasten 16 0 8 0 737 306 647 306;
#P fasten 9 0 8 0 656 306 647 306;
#P connect 46 0 8 0;
#P connect 28 1 6 0;
#P connect 26 0 6 0;
#P connect 45 0 6 0;
#P connect 52 0 6 0;
#P connect 44 0 45 0;
#P fasten 2 1 28 0 75 206 539 206;
#P connect 15 0 12 0;
#P connect 14 0 4 0;
#P connect 13 0 14 0;
#P connect 12 0 13 0;
#P connect 25 0 23 0;
#P connect 24 0 23 0;
#P fasten 2 5 23 0 171 180 348 180;
#P fasten 23 0 10 0 348 303 304 303;
#P fasten 2 4 10 0 147 190 304 190;
#P connect 48 0 10 0;
#P connect 21 0 7 0;
#P connect 50 0 48 3;
#P connect 51 0 48 2;
#P connect 49 0 48 1;
#P connect 3 0 22 0;
#P fasten 7 0 3 0 259 248 51 248;
#P lcolor 7;
#P connect 2 0 3 0;
#P lcolor 7;
#P fasten 2 6 3 0 195 243 51 243;
#P lcolor 7;
#P fasten 2 2 3 0 99 233 51 233;
#P lcolor 7;
#P connect 2 3 3 0;
#P connect 1 0 2 0;
#P connect 5 0 1 0;
#P window clipboard copycount 53;


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