PDA

View Full Version : 3d texturing.....



miko
03-02-2003, 08:27 AM
i rendered a single 3d textured tri and... my engine slowed from 65 fps to 20fps http://www.opengl.org/discussion_boards/ubb/frown.gif that texture was 16x16x16. what could be wrong? my code looks like this:

glEnable(GL_TEXTURE_3D);
glBindTexture(GL_TEXTURE_3D, my1st3dtex);
glBegin(GL_TRIANGLES);
glNormal3f(0,1,0);
glTexCoord2f(0,0);
glVertex3f(1.5,0,-5);
glTexCoord2f(1,0);
glVertex3f(.5,.5,-5);
glTexCoord2f(0,1);
glVertex3f(.5,0,-5);
glEnd();
glDisable(GL_TEXTURE_3D);

...and this small piece of code blows my engine to hell

and one more question: how are 2d and 3d textures combined together. because when i remove that enable/disable each glBingTexture(GL_TEXTURE_2D,*) does not seem to have any effect...

i'm running win98, geeforce2mx, my window is 640x480 on 1024x768 16 bit color desktop...

so that's the problem, if you have some idea, plz tell me...

Jan
03-02-2003, 09:14 AM
I donīt know how you do that, but my Geforce 2 Ti, does NOT support 3D textures, as far as i know.
So, if your driver supports it, itīs certainly done in software-mode and that explains the slow-down.

Jan.

miko
03-02-2003, 09:22 AM
ufff... nasty http://www.opengl.org/discussion_boards/ubb/mad.gif

shinpaughp
03-02-2003, 12:07 PM
3D textures are supported as of OGL v1.2 - both of your GPUs should support it. Of course, it is an extension, and is not supported by software which on Windows is limited to v1.1.

I've never tried using it, but I would expect that a 3D texture would probably like 3D text coords as opposed to 2D. But, again, I've never used it, so I dunno.

[This message has been edited by shinpaughp (edited 03-02-2003).]

miko
03-02-2003, 12:47 PM
and we are exactly at point where we started.... http://www.opengl.org/discussion_boards/ubb/rolleyes.gif

shinpaughp
03-03-2003, 02:39 PM
I was wrong about the 3D tex coords, as you already knew. I created a little test app and it appears the probable reason for the slow fps is fill rate as it appears to redraw all levels of the 3D texture for each rendering pass. When my 3D texture filled the screen, I was down to about 1 fps in a 500 x 500 window. When I went full screen 1280 x 1024 it was about 1/3 fps.

Not sure what your needs are, but probably you are better off with 2D texture mapping, unless it is absolutely necessary you use 3D. Or use glTexSubImage3D if you only need to see 1 or 2 levels at a time. I didn't try it, but I am sure it will be faster.

So, out of curiosity, what are your needs? What are you looking to do?