Strange Lines on Texture Image

Going through the samples in Starter.pdf (like you didn’t know by now) and when I am placing a texture I get strange line. The following screenshot is an example



Screenshot



FYI - That is a picture of my Boss, not me. :smiley:



Anyway, the texure is a JPG file so I am not sure if this might be causing the problems (strange decoding behavior in the Texture Loader) or what the deal might be. I am loading the texture just as the example specified:



Texture t=TextureManager.loadTexture(myTexture ,Texture.MM_LINEAR, Texture.FM_LINEAR,true);



Thanks

Gregg

hehe, nice pic :slight_smile:



What happened is that the image’s size is not the power of 2.



E.g. 128x128, 256x256



So what OpenGL does is add lines to compensate. Simply rescale your image, and it should all work.



DP

"DarkProphet" wrote:
hehe, nice pic :)

What happened is that the image's size is not the power of 2.

E.g. 128x128, 256x256

So what OpenGL does is add lines to compensate. Simply rescale your image, and it should all work.

DP

Ahhh, ok, thanks. ://

I had an old program that used to work. When I updated to the new version of JME and a new computer I had the same problem. Is this something that only happens on some computers or did they change lwjgl to make it not work?



By the way I read that Opengl 2.0 got fixed the problem.

Here is the quote form the Opengl 2.0 specification.




I.3 Non-Power-Of-Two Textures
The restriction of textures to power-of-two dimensions has been relaxed for
all texture targets, so that non-power-of-two textures may be specified without
generating errors. Non-power-of-two textures was promoted from the
ARB texture non power of two extension.

it was card dependant on what to do with non power of 2 textures. If they formalized support for non pow-2 textures in opengl 2.0 then you still need a card that’s 2.0 compliant. So the best bet is to always use power of 2 sized textures (and generally using square ones is even better regarding compatibility.)