[1.3.1] opengl texture bug

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

[1.3.1] opengl texture bug

Post by white tiger »

here are a screen of a my model in dx

Image

here are the same model in opengl

Image

I think there is something wrong with texture mapping in opengl. It worked fine both with dx and ogl in version 1.1. Some ideas, please?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

What kind of model is it? Any code which is relevant in this situation?
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post by white tiger »

it's md2. The attached texture is 129x66. I have other md2 models with textures with size as power of 2 and they work well :?

Also the billboard. If the attached texture is not a power of 2 the billborad is showed incorrect, only in ogl. Here are 2 screens with non-pow of 2texture billboard

opengl

Image

directx9

Image

I can upload the medikit model (from the first post) and the textures if that can help :wink:
liger13
Posts: 119
Joined: Tue Jul 18, 2006 4:17 am

Post by liger13 »

i have the same problem as well. opengl used to work fine in the last 1.3 i beleive.

direct3d9:

Image

opengl:
Image

it seems the lighting of the terrain is also different, but thats another topic :P
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, that should be enough to track it down. Should be somewhere in the copy-to-scale parameters.
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post by white tiger »

Some news?

I have tried to swap getOriginalSize and getSize in COpenGlTexture class as you have told me in the other post in Open Discussion but this doesn't fix it.

So it it a bug in copytoscaling?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I did not find a bug in copyToScaling. However, I'll add a slightly improved one soon (though just performance issues).
I could also not reproduce the billboard problem. My textures are shown correctly even with odd dimensions. At first I thought my system has NPOT support, but it does not. So in my example the scaling is correctly done. Maybe you can upload the medipack mesh now? Seems to be the best example.
Wyszo
Posts: 49
Joined: Sun Jun 24, 2007 8:44 am

Post by Wyszo »

Maybe it's just some kind of a problem with ARB_non_power_of_two on white tiger's graphics card?

EDIT: orthography :P
Last edited by Wyszo on Mon Jul 02, 2007 11:41 am, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

So the other way round, maybe. I also think that the two problems are not related. Probably the latter one is fixed by the OriginalSize patch. The other one could be relate to texture matrices. Since it's a q3 level there are texture matrices used in the code. Perhaps the medipack is affected by those matrices, i.e. they are still not properly reset. I'll need the models...
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post by white tiger »

I can't reproduce the bug :cry: :cry: :cry:

I wrote a simple program wich load the medikit using opengl and it's textured correctly.

So I modified it to load the quake 3 level model and the md2 model of the weapon (animated) and 3 medikits (because in my game there are lots of medikits) and they all are still textured correctly.

However in my game with opengl they aren't textured correctly (in dx9 & dx8 yes)

Also in my game the option menu is not correct in opengl. I load one of its texture in my program, render use draw2DImage and it's showed correctly.

But since with 1.1 AND 1.3 all worked fine in my game and since with dx9 & dx8 the textured is rendered correctly it must be a bug of the engine
(because if in my code there is something wich make the texture showed incorrectly so there is a bug in dx9 that show it correctly )

Sure in my game there are lots of scene node: oct trees, animated, billboard, billboard text scene nodes, "normal" text scene nodes, lights, exc.. but I can't test for every scene node

Help hybrid :cry:
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post by white tiger »

They are NOT: the lights, the skybox, the ammunation md2 models and the quake 3 level model (i deleted the quake 3 level model from my game and the medikits are still textured incorrectly)

Help me :(
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Simply strip more and more from the program until the error disappears. If it's small enough to send it to me then just do so (check my webpage for a mail addresse). Maybe you can also debug your scene with some OpenGL debugger. Check the material settings of the medipack.
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post by white tiger »

I GET THE BUG!!!!!! 8)

or... I get the line wich cause the bug, but can't get the bugged code inside irrlicht by myself :cry:

I wrote a program to demostrate the bug. I wrote also a readme.txt file with the information of the debug in my system. I think the bug is in the constructor of CImage wich takes the color format and another image.

In fact the bug is caused by irrlicht when it tries to convert a R8G8B8 image (24 bit) into a A1R5GB5 image (if you select ECF_ALWAYS_16_BIT as texture creation flag) in COpenGLTexture::getImageData().

Hope this can help :wink:

Demo

P.S. i have nvidia 6200 with support for NPOT texture , AMD 2500+ 3d now, win xp SP2, opengl version 2.0.3
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, then it came in because I added this method call. It was probably bugged ever since, but not used. Unfortunately this method uses the Blit() function which is pretty obscured - so it might take some time until I find the real cause.
Post Reply