[Mesa-users] trouble with mipmap minification filtering

David Hart dahart at gmail.com
Tue Aug 12 12:22:44 PDT 2014


> From my quick look, the "glut" path uses hardware rendering, while the
>>>
>> "mesa" path uses osmesa pure software rendering.  So it looks like
>> osmesa has the issue.
>>
>
> David, try adding a glTexEnv() call to set the texture env mode.  The
> default is GL_MODULATE but since you're not specifying vertex colors, maybe
> that's causing trouble.
>


Thanks guys. Yes, my terminology was mixed up, sorry, its native (hardware)
OpenGL I'm using in my "glut" path, and full software rendering in the
"mesa" setup.

I took your suggestion Brian to print the version strings, they look like
this for me:
> mesa_mip_test.py 0 && mesa_mip_test.py 1

G L U T
GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: AMD Radeon HD 6750M OpenGL Engine
GL_VERSION: 2.1 ATI-1.24.35
GL_SHADING_LANGUAGE_VERSION: 1.20

M E S A
GL_VENDOR: Brian Paul
GL_RENDERER: Mesa OffScreen
GL_VERSION: 2.1 Mesa 8.0.5
GL_SHADING_LANGUAGE_VERSION: 1.20


I have also tried setting the texture mode via glTexEnv(), that doesn't
seem to help. The one thing I did notice in my mesa path is the textures I
expected to sample different mipmap levels are respecting
the GL_TEXTURE_MAG_FILTER settings - I can see a difference when I change
the mag filter from GL_NEAREST to GL_LINEAR.

Someone on stack overflow mentioned he'd had trouble and found that he
needed to set his tex params after glBindTexture() but before
glTexImage2D(). I tried setting the tex params in various places, but for
me it didn't seem to change anything.

The texture wrap settings I had were intentional, and work as expected in
both my native and software paths, but they are irrelevant to this test and
I should have left them out. I've been pruning everything unnecessary to
narrow it down, and I changed the checker texture to have uniform sized
checks in case that was confusing to look at.

I'm thinking my next steps are to find sample code somewhere that does
demonstrate working mip-mapping in mesa, and carefully diff it against my
own - I'd love to know if anyone has such code they'd be willing to share,
or knows where some might live. I've found some incomplete examples while
googling that will take some work to run. And if that doesn't turn up
anything, I'm planning to port my code to C to rule out python and/or
pyopengl.

There isn't anything I should need to do in the fragment shader or to the
sampler used in the shader to get mipmapping working? Or might I need to be
doing something more three-dimensional to see my mipmap levels?

Updated code & results are here:
https://dl.dropboxusercontent.com/u/364079/mesa-mipmap/version2/mesa_mip_test.py
https://dl.dropboxusercontent.com/u/364079/mesa-mipmap/version2/mip_test_glut.png
https://dl.dropboxusercontent.com/u/364079/mesa-mipmap/version2/mip_test_mesa.png

--
David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-users/attachments/20140812/787b6eb7/attachment.html>


More information about the mesa-users mailing list