Jump to content
  • Advertisement
Sign in to follow this  
aznium

Textures

This topic is 4253 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I got my NPOT textures working, however speed is something to be desired.
hwidth = 960; //(1920 / 2)
height = 1080;

...

glBindTexture(GL_TEXTURE_RECTANGLE_ARB, texture1);
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGB, hwidth, height, 0, GL_RGB, GL_UNSIGNED_BYTE, partialFrame1);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, texture2);
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGB, hwidth, height, 0, GL_RGB, GL_UNSIGNED_BYTE, partialFrame2);
its taking around 10ms to 30ms to load 2 textures of 960x1080 ... is it possible to bring this number down to 2 to 6ms? Also, I am using double-buffering. this call:

...
//glBegin...Quad...glTexCoord2f...glVertex2f...
//...draw
//...the
//...texture
//glEnd
...

SwapBuffers(hDC);
usually takes 2ms, but sometimes jumps to 45ms!!! any ideas? the hardware on this machine is core 2 duo E6700, 4 gigs ram (DDR2 400), Quadro FX 1500 thanks all!

Share this post


Link to post
Share on other sites
Advertisement
i switched to using

glTexSubImage2D

since i am reusing texture1/texture2...

and i got a slight boost there.

(btw. each texture only gets displayed once before it gets discarded....its something like a video player)

Share this post


Link to post
Share on other sites
Try using a format supported by the hw like BGRA or RGBA.
No GPU supports RGB as far as I know. They are converted to BGRA or RGBA by the driver and then uploaded. I know that BGRA is typically the prefered form.

Share this post


Link to post
Share on other sites
my source is RGB i can make it BGR if necessary .

wont adding a alpha channel waste memory? and will it improve speed A LOT? or jsut a bit?




vysnc already disabled . and my panel is 120hz...shouldnt jump to 45ms?

Share this post


Link to post
Share on other sites
This heavily depends on which hardware you are using.
On nVidia Cards you can safely use BGR and even benefit from the saved memory.
On ATI, the card can not handle 3-compononent textures. The Driver has to interleave it to convert it to BGRA which can involve an additional system memory copy. The memory is wasted on GPU anyway.

Another default hint for fast texture uploads: Take a look at Pixel Buffer Objects. They allow you to specify a texture upload and do something else while the GPU loads up the data independently. Of course this won't save anything if you have not much to do besides texture uploads.

Share this post


Link to post
Share on other sites
my source is either RGB or BGR . that can not be changed

my source is also RAM




so are you suggesting this

RAM->Pixel Buffer Object->VRAM->Display

?

thx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!