Re: [PyOpenGL-Users] Compressed Textures
Brought to you by:
mcfletch
|
From: Alejandro S. <as...@gm...> - 2014-10-06 02:25:46
|
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 <mcf...@vr...>: > 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 > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > |