How can I load 8 bit bmp with OpenGL?

前端 未结 2 761
失恋的感觉
失恋的感觉 2021-01-16 17:59

Here is my situation: I need to preload 2000 images and display them in sequence to be an animation in 60 fps. Currently, I am using OpenGL to load bmp files, but due to mem

2条回答
  •  -上瘾入骨i
    2021-01-16 18:43

    Maybe you don't need to have 2000 images and display them at 60fps at all? Stable 25fps is just enough for any movie.

    I encourage you to rethink your original problem and come up with a better suited solution (video, animation, vectors, maybe something else)

    As for original question:

    If you need images only once - put them to memory when you need them and discard them right after displaying.

    Use DXT packed images. With a slight degrade in quality you get a constant x4/x8 compression ratio.

    OpenGL is not very good at working with paletted textures these days (many vendors have poor implementations). But you can implement that with shaders.

提交回复
热议问题