is there any way of cropping a texture (say use only 100x100 of an 128x128 texture) without modifiyng geometry’s tex coords?
what i want seems kinda the same as add some prescaling for tex coords inside a texture objects’ state, glcontext state or maybe TexEnv but not inside the geometry/vertex-shader attributes.
If your texture coordinates are in the 0.0 to 1.0 range for the 128*128 texture, use a texture matrix with a scale factor
100/128 0 0 0
0 100/128 0 0
0 0 1 0
0 0 0 1
Be warned, you won’t be able to get the border handling right on the non-zero text coords, unless you use nearest filtering.
Repeating the texture will also not work. You could do that in a fragment shader by calculating the wrapping yourself.
thanks.
i first made it obsolete by using NPOT rectangle textures but then figured out on radeon they are limited to be multiples of 32 in both axes leading to very strange results otherwise (damaged texture, if height don’t match TRASHED geometry DAMN that was looking crazy!)
so i need to clamp to multiples of 32 and need the croping anyway…
thanks a lot
Paul
Well, that was a driver bug in early FBO implementations, but it was fixed quite a while ago. It ought to be in public driver by now I think. The hardware definitely has no such limitation.
ok, tracked it down to mod 32 for width and mod 8 for height
some better now… but still not solved.
my current driver is 6.14.0010.6561, about two months old, just one month older then the actuall released. the card is a X300 one.
now i try for newer drivers.
that proofs we’re a real high tech commumity here if something is older than a month its considered “absolutely outdated” and no one can complain about strange results…