[GEM-dev] svn update break rectangular texture with shader

IOhannes zmölnig zmoelnig at iem.at
Sat Jan 16 12:27:13 CET 2010


cyrille henry wrote:
> 
> hello,
> 
> i just did an svn update. lots of file have changed. (last update was 21
> december)
> after building gem, i realized that few shaders example did not work
> any-more.
> it look to be related with rectangular texture : if you open shader
> example 1 : simple texture : it work ok with non rectangular texture
> (but the texture is upside down), but it does not work at all in
> rectangular mode...

i started to unify as much code as possible and try to reduce all the
hacks handling different image orientations and non/rectangular textures.
obviously the process is not finished yet :-(


- in the past, linux/w32 acquired pixes (images, video,...) in openGL
orientation starting bottom-left (usually by flipping the images
manually, since most image-APIs will return them top-left), whereas osx
acquired them in top-left orientation and set the "upside-down" flag,
thus being more performant (no pixel-wise flipping required)
now, Gem will acquire the image in the same way on all OSs (top-left).

- the code was full of special handling for rectangular vs normalized
texture coordinates. removing the cruft basically involved setting up a
texture transformation matrix that would make the rectangular textures
behave the same as normalized textures (mainly this is done by
premultiplying the texcoords with a matrix that transforms 0..1 to
0..xsize and the like).

this basically means that now the texcoords should always appear to be 0..1.
since the "sampler2DRect" expects texcoords to range from 0..xsize (and
similar), it now fails.

> hope that could be fixed soon

me too.

fmgasdr
IOhannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20100116/8baf07e6/attachment.pgp>


More information about the GEM-dev mailing list