Sign in to follow this  

compression

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

This topic is 4341 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this