3ds and opengl - beginner
by Arik · in Technical Issues · 06/25/2004 (5:21 am) · 1 replies
Hi, guys.
I make some experiments in combine 3ds and opengl.
I crate a box which is not much big.
I put textures on this cube. and I save it as a 3ds file.
and when I try to load this cube in opengl the frame rate of the program become extremly slow - it drops from something like 60 frames per second to something like 30 frames per second.
when I do the same, but instead of using box I use a lot of plan polygons (regular square) - and when I export it to opengl the program run fine - it's not interupt the frame rate at all - as it should be, i think.
is there something i should know?
thank you.
I make some experiments in combine 3ds and opengl.
I crate a box which is not much big.
I put textures on this cube. and I save it as a 3ds file.
and when I try to load this cube in opengl the frame rate of the program become extremly slow - it drops from something like 60 frames per second to something like 30 frames per second.
when I do the same, but instead of using box I use a lot of plan polygons (regular square) - and when I export it to opengl the program run fine - it's not interupt the frame rate at all - as it should be, i think.
is there something i should know?
thank you.
Associate Matt Fairfax
PopCap
What are you using to load the 3ds file? A custom loader that you wrote or something you dld'ed?
Changing textures is costly in OpenGL (or Direct3D for that matter). The 3ds format gives you the information needed to sort the triangles by texture so that you can minimize texture swapping. It is also wise to check to make sure that you aren't swapping out the same texture multiple times (if it is already in use). I am guilty of not doing that myself =)
Here is a general purpose OpenGL 3ds loader/renderer that I wrote a long time ago. Maybe it can be helpful to you...