LWJGL Forum

Programming => OpenGL => Topic started by: chriddle on March 09, 2005, 10:08:06

Title: displaying large textures (composed from small ones)
Post by: chriddle on March 09, 2005, 10:08:06
Hi there,

I'd like to display some kind of video sequence in my game. therefore we rendered it (taken from 3d studio) in 512x384 resolution (to use less RAM in the game).
then we cut the frames in pieces of 128x128 (4 horizontal and 3 vertical) to display them as textured rectangles in opengl.

so far so good - it works perfectly when I show the video in 512x384. but when i display it in 800x600 (so every piece is zoomed to 200x200) we see small horizontal and vertical lines between the texture pieces  :(

i ran a search through this forum and red something about "clamp_to_edge" but it doesnt changed anything  :?

anyone can help?

here's a screenshot of the video (and the hor. and vert. lines):
(http://www.eolh.com/mh2.jpg)

thanks in advance,

chris
Title: hmmmm...
Post by: Fool Running on March 09, 2005, 19:14:58
Are you applying texture filtering to the textures? (Bi-linear, Tri-linear)

I think the lines are sometimes a result of filtering.  (I could be wrong  :lol: )
Title: displaying large textures (composed from small ones)
Post by: chriddle on March 09, 2005, 23:01:46
yep! perfect answer!!!   :D

i found the following lines:
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);

GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);

and i changed them to:
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);

GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);

now the lines have disappeared  :D
i only hope that it doesnt slow down the rendering.  :?

thanks a lot

chris
Title: displaying large textures (composed from small ones)
Post by: princec on March 09, 2005, 23:25:31
If anything it'll speed it up.

Cas :)
Title: displaying large textures (composed from small ones)
Post by: Chman on March 10, 2005, 01:48:51
.. but you'll get a horrible result if you zoom on the texture ...

Chman