Forums > Jitter

Gridshape texture resolution

May 26, 2006 | 1:16 pm

Hi,

When I put a texture on a videoplane, the texture resolution appears to be higher than a texture on a gridshape.

Is there a way to increase the resolution of a texture on a gridshape?

Cheers,
Mattijs


May 26, 2006 | 3:25 pm

change the dim attribute of the gridshape object itself.


May 26, 2006 | 4:21 pm

Hi, thanks for your reply.

As far as I can see, the dim message changes the resolution of the gridshape itsself, not of the -texture- of the gridshape.

Mattijs


May 26, 2006 | 4:40 pm

I have narrowed down my problem. In case of a videoplane you can either send the texture to the renderobject or to the videoplane object. A gridshape hasn’t got the last option.

When I use the method of sending the texture to the render, the resolution is half of when I send the texture to the videoplane. The patch below illustrates this.

Hope anyone recognizes this.. ?

For the texture I use this jpg, it contains clear edges and high contrast:

http://www.oli.tudelft.nl/avdl1064/Eboman-Logo.png

#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P user com 140 39 128 196617 24;
#K set 0 12320 15648 29797 30836 30066 25888 29807 8306 25966 25701 29197 12576 15648 29797 30836 30066 25888 29807 8310 26980 25967 28780 24942 25856;
#K end;
#P window linecount 1;
#P comment 103 67 66 196617 read texture;
#N vpatcher 351 546 1217 958;
#P window setfont "Sans Serif" 9.;
#P newex 306 51 41 196617 sel 0 1;
#P message 303 106 78 196617 matrixoutput 0;
#P newex 321 83 30 196617 t b b;
#P message 303 142 91 196617 rotatexyz 0. 0. 0.;
#P button 241 297 15 0;
#P message 303 124 44 196617 texture;
#P newex 168 86 20 196617 t b;
#P newex 429 316 32 196617 sel 1;
#P newex 376 316 51 196617 zl slice 1;
#P newex 317 316 57 196617 route read;
#P window linecount 2;
#P newex 164 176 268 196617 jit.gl.videoplane ding @depth_enable 1 @smooth_shading 1 @lighting_enable 0 @auto_material 1 @color 1. 1. 1. 1.;
#P window linecount 1;
#P message 187 142 103 196617 rotatexyz 0. 0. 180.;
#P message 187 124 76 196617 texture mytex;
#P user jit.fpsgui 81 317 60 196617 0;
#P newex 208 335 114 196617 prepend texture mytex;
#P newex 208 316 105 196617 jit.qt.movie 400 400;
#P message 187 106 78 196617 matrixoutput 1;
#P newex 36 115 48 196617 loadbang;
#P message 47 155 70 196617 camera 0 0 2;
#P message 36 137 105 196617 light_position 1 1 1 0;
#P newex 81 222 58 196617 t b erase b;
#P newex 81 201 57 196617 qmetro 40;
#P newex 81 355 150 196617 jit.window ding @size 400 400;
#P newex 81 297 86 196617 jit.gl.render ding;
#N comlet (bool) mode;
#P inlet 306 34 15 0;
#P inlet 208 296 15 0;
#P inlet 81 181 15 0;
#P connect 9 0 7 0;
#P connect 9 0 8 0;
#P connect 0 0 5 0;
#P connect 5 0 6 0;
#P connect 16 0 3 0;
#P fasten 8 0 3 0 52 287 86 287;
#P fasten 7 0 3 0 41 287 86 287;
#P connect 12 0 3 0;
#P connect 6 1 3 0;
#P connect 6 0 3 0;
#P connect 3 0 13 0;
#P connect 11 0 16 0;
#P connect 23 0 16 0;
#P connect 21 0 16 0;
#P connect 15 0 16 0;
#P connect 14 0 16 0;
#P connect 10 0 16 0;
#P connect 6 2 16 0;
#P connect 25 0 16 0;
#P connect 26 0 20 0;
#P connect 20 0 10 0;
#P connect 20 0 14 0;
#P connect 20 0 15 0;
#P connect 22 0 11 0;
#P connect 1 0 11 0;
#P connect 11 0 12 0;
#P connect 19 0 22 0;
#P fasten 24 0 22 0 326 292 246 292;
#P connect 24 1 25 0;
#P connect 24 1 21 0;
#P connect 24 1 23 0;
#P connect 2 0 26 0;
#P connect 11 1 17 0;
#P connect 26 1 24 0;
#P connect 17 0 18 0;
#P connect 18 1 19 0;
#P pop 1;
#P newobj 16 103 119 196617 p render;
#P toggle 124 39 15 0;
#P message 70 67 30 196617 read;
#P toggle 16 85 15 0;
#P comment 33 85 36 196617 render;
#P connect 3 0 4 2;
#P connect 2 0 4 1;
#P connect 1 0 4 0;
#P window clipboard copycount 7;


May 26, 2006 | 4:50 pm

As of Jitter 1.5, the preferred method of texturing objects is to use
jit.gl.texture or jit.gl.slab. This will give you many more quality
options, and is more reliable.

Cheers,
Andrew B.


May 26, 2006 | 4:58 pm

Hi Mattijs,

I’ve always wondered what the real difference is between a plane shaped
gridshape and a videoplane. Only thing I can think of is that
jit.gl.videoplane is capable of texture interpolation. Maybe this is the
reason why your texture appears to have a higher resolution on a videoplane?

-thijs


May 26, 2006 | 5:14 pm

Hi Andrew, thanks for the tip, checking it out right now. Maybe in that case it’s time for the jit.gl.gridshape help to be updated? ;)

Hee Thijs! I thought about that too. I compared the output of my patch with the image in an image viewing app. The texture-to-render method definitly down-grades the resolution of the texture. Btw in the patch I set the jit.qt.movie to the exact dimensions of the image.

Greets,
Mattijs


May 26, 2006 | 5:35 pm

Andrew, that did it! Thanks a lot!


May 26, 2006 | 6:03 pm

Hi Mattijs,
To clarify, jit.gl.render uses power-of-two textures by default. This
means that your 400×400 image is getting resampled to some power of two
without interpolation. Using jit.gl.texture provides a more friendly
interface for managing textures, and will use rectangular textures by
default (as opposed to power of two), so you will not run into the
aliasing issues. Note also that interpolation can be turned on and off
with jit.gl.texture by using the @filter attribute.

jit.gl.render can create rectangular textures by sending the message
sequence:

texture name ,
usetexture name,
sendtexture rectangle 1

You can also turn off the @rectangle attribute of jit.gl.texture if you
need to use power-of-two textures (as some video cards have limitations
with rectangular textures).

Cheers,
Andrew B.


May 26, 2006 | 6:56 pm

I understand, so render auto-resampled my texture to 256 x 256, videoplane didn’t, which caused my confusion. Thanks again.

I believe it would be good to introduce jit.gl.texture in the various helpfiles. If you don’t know what you’re doing it is better to copy a setup that works by default. At least consider placing jit.gl.texture under ‘see also’.

… Hope I don’t sound too critical ;)

Cheers,
Mattijs


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