[fixed]OpenGL- loading 3d model problem

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
qez111
Posts: 54
Joined: Mon Apr 28, 2008 9:44 pm

[fixed]OpenGL- loading 3d model problem

Post by qez111 »

Note : The following bug occurs only in OpenGL Mode. DirectX9 mode works fine.

I have noticed that my program freezes on loading a 3d model. I have checked two formats: 3ds and b3d and in both cases the program simply freezes after it says 'Loaded mesh: 3ds.3ds' (Note: it freezes/hangs. it does not crash.)
I tried to trace the problem and it seems that it has started occurring only in Rev 1329 and later.

To reproduce this bug, you can simply open the MeshViewer (Tutorial 9), and try to load a 3d model in OpenGL Mode. And you will notice that the program will hang/freeze.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

That's definitely not abug visible for everyone - at least I just tried mayn meshes today and had no problems at all.
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

actually this may be a bug with your display driver (make sure the program is hanging when it's loading the model, not displaying the scene). My laptop hangs for about 25 seconds every time drawing is called (when it's being run in OpenGL...works fine in DirectX >.>); for me, this appears to be a video card driver bug, and updating the driver did not solve it, so at the moment I'm developing using DirectX instead of OpenGL :(

So, ya...that might be relevant :\
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
qez111
Posts: 54
Joined: Mon Apr 28, 2008 9:44 pm

Post by qez111 »

If it is a bug with my display driver, then I am wondering why it is working perfectly with revisions 1328 and earlier revisions. It loads perfectly with the earlier versions. Why only after Rev1329 this problem is occurring? And it is freezing for indefinite time. I tried waiting for over 20 minutes but still the mesh viewer (and my program as well) is frozen.
I tried on three different systems, but this problem is there on all of them. But yes, all of them are using ATI Radeon cards. But I couldn't possibly think it is a bug with the graphics card, because of the fact that the mesh viewer (and my program as well) works properly (i.e. in OpenGL mode) when compiled with rev 1328 and earlier.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

if you have a non pow 2 texture, in most recent OpenGL build (no idea at all when it started) and a pretty old video card or old drivers, the app can take incredibly long time to process the texture. I have no idea what is your setting, but when doing a draw2dimage, with aforementioned conditions, it would take my old system from 30 to 60+ ms per image drawn, stalling at the rectangle creation. Thus, if your model is getting created, it might be that each and every triangle strip takes that huge amounts of time. Try drawing your model's texture with draw2dimage if you think that might be the case. If it lags like... you'll know what to follow. If not, well, gl ;)
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

The graphics card that had the problem for me was an ATI Radeon Express 1100 (it's a laptop card), so the problems very well may be related.

Dorth, I just realized that some of my textures are non-power of two textures, so I'm definitely going to resize them and see if that fixes the problem...thanks for the heads up! :)

*UPDATE* just tested it out after resizing all my textures to a power of two, and...it works! Dorth, you rock! ^_^
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Yeah, that's a nasty one... It should definitively be stretched to a pow2 once at load by default if whatever is needed isn't supported. The cost is just too great if not :?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

OpenGL doesn't tell when it falls back to SW rendering. So it's impossible to test for such things. However, I've checked NVidia's driver lists and they tell that none of their drivers does fall back to SW rendering for NPOT. either it's supported (and then in HW) or not at all. Don't know for sure for ATI, but it should be similar. The NPOT rendering should be only slightly slower, if at all.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Well, something, somewhere...
qez111
Posts: 54
Joined: Mon Apr 28, 2008 9:44 pm

Post by qez111 »

You are right, when I change all textures to make it power of 2 size, it loads!
But I still believe it would be good for the engine to handle the non-power of 2 images. This would make it easier to support the already created projects. which did not have power of 2 images.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, the only change which could be related to this problem is that I added another check for the OpenGL version. In case this is 2.0 or higher, the NPOT support is enabled, i.e. textures are not resized anymore, but kept in their native sizes. In case ATI really has a problem here it could be that some weird things are going on. Could you please post the console log of your app upon startup?
Post Reply