Jump to content
  • Advertisement
Sign in to follow this  
Harrism

compression

This topic is 4647 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

Say you wanted to use your own compression. Reasons don't matter. Would it be possible to use the decompressed bitmap contents directly from memory as a texture rather than decompressing it, saving it to a filename and loading it from there? say x = 'entire contents of bitmap'; instead of auxDIBImageLoad(filename); I'm just asking if it's possible. If it's already in memory it'll be faster to load, rather than copying it back to the hard disc then having it resubmitted back to memory.

Share this post


Link to post
Share on other sites
Advertisement
Yes, that's possible. You would have to decompress the image to a format OpenGL understands. Then you could (for example) use the glTexImage2D-function to upload the texture from main memory to video memory.

Share this post


Link to post
Share on other sites
It'd end up being a bitmap, I would think GL would understand this, altho if it was being moved from memory to video memory as you put it, I'm not sure if I'd have to translate it myself first. OpenGL could be so much better at handling this.

Would gluBuild2DMipmaps be another possible subroutine? since glTexImage2D can only load to a dimention to the power of 2.

Share this post


Link to post
Share on other sites
Don't worry I think I understand it after reading the documentation on gluBuild2DMipmaps. I think I understand how it works. Ta.

Share this post


Link to post
Share on other sites
for the record, you can upload textures with non-power of 2 sizes, but they are handled very slowwwwwwwwwly. I really noticed this when I was trying to port secret maryo chronicles from sdl to pure openGL. most of their graphics werent sized optimally and I was all like WHY THE HELL IS IT RUNING SO SLOWWW lol.

Share this post


Link to post
Share on other sites
Quote:
Original post by AAAP
for the record, you can upload textures with non-power of 2 sizes, but they are handled very slowwwwwwwwwly. I really noticed this when I was trying to port secret maryo chronicles from sdl to pure openGL. most of their graphics werent sized optimally and I was all like WHY THE HELL IS IT RUNING SO SLOWWW lol.


This is not true for all cards, most older cards will simply fail the function and hope you do something about it, you'll usually end up with a white blank texture. on some newer cards you get extreamly slow proformance, and on the newest cards, that support NON_POWER_OF_TWO extention, you get full proformance.

Share this post


Link to post
Share on other sites
NON_POWER_OF_TWO is an core feature in GL 2.0, on NVIDIA 6XXX and newer hardware support this. But still strongly support use pow of 2 texture.

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!