Re: Compressed Textures

Alejandro Segovia <[email protected]> Sun, 5 Oct 2014 22:25:18 -0400
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAAXrc9P+Uez39ctke_jqhY0yfWJVDZmWU-8HVZ+f15n4ufSCSg@mail.gmail.com>
Hi Mike,

Thank you for your answer. I ended up finding the problem, but realized
that maybe my description wasn't as accurate as I thought. What I was
trying to do was load a DXT5 compressed texture. That's why I was using
glCompressedTexImage2D. I was not trying to compress a texture.

The problem was caused by the fact that DXT5 textures already include all
their mipmap levels, which is a problem when working with OpenGL because
you are basically expected to supply the mipmap levels one at a time. This
(old) paper I'm linking here describes how to do the math to achieve this:
http://www.oldunreal.com/editing/s3tc/ARB_texture_compression.pdf (C++ code)

Alejandro.-

2014-09-30 15:15 GMT-04:00 Mike C. Fletcher <[email protected]>:

> On 14-09-27 01:02 PM, Alejandro Segovia wrote:
> > Hey guys,
> >
> > I'm having trouble figuring out how the binding works for the S3TC
> > compressed textures extension.
>
> I don't see anywhere in your code where you are compressing the content
> with s3tc_dxt5 compression. I believe (though I have no experience using
> compressed textures), that if you're just trying to get the GL to use an
> internal format with compression you need something like:
>
>          glTexImage2D(
>              GL_TEXTURE_2D, 0,
>              GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, # internal format...
>              ix, iy, 0,
>              GL_RGBA,
>              GL_UNSIGNED_BYTE,
>              image
>          )
>
> so that the GL will do the compression of the data. Incidentally,
> there's a bug in the handling of uploading compressed texture data
> (refactoring error), a fix for that should go out in the next release.
>
> Sample code here:
>
>
> http://bazaar.launchpad.net/~mcfletch/openglcontext/trunk/view/head:/tests/nehe6_compressed.py
>
> HTH,
> Mike
>
> --
> ________________________________________________
>    Mike C. Fletcher
>    Designer, VR Plumber, Coder
>    http://www.vrplumber.com
>    http://blog.vrplumber.com
>
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> PyOpenGL Homepage
> http://pyopengl.sourceforge.net
> _______________________________________________
> PyOpenGL-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyopengl-users
>

------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users