Skip to content

Commit

Permalink
Stage3D mip filter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jgranick committed May 5, 2017
1 parent 08e9fd5 commit 2054292
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions openfl/_internal/stage3D/AGALConverter.hx
Expand Up @@ -969,12 +969,12 @@ private class SamplerRegister {
// nearest
case 1:

minFilter = (f != 0) ? GL.NEAREST_MIPMAP_LINEAR : GL.NEAREST_MIPMAP_NEAREST;
minFilter = (f != 0) ? GL.LINEAR_MIPMAP_NEAREST : GL.NEAREST_MIPMAP_NEAREST;

// linear
case 2:

minFilter = (f != 0) ? GL.LINEAR_MIPMAP_LINEAR : GL.LINEAR_MIPMAP_NEAREST;
minFilter = (f != 0) ? GL.LINEAR_MIPMAP_LINEAR : GL.NEAREST_MIPMAP_LINEAR;

default:

Expand Down
2 changes: 1 addition & 1 deletion openfl/display3D/textures/CubeTexture.hx
Expand Up @@ -158,7 +158,7 @@ import openfl.utils.ByteArray;

if (!state.equals (__samplerState)) {

if ((state.minFilter == GL.LINEAR_MIPMAP_LINEAR || state.minFilter == GL.NEAREST_MIPMAP_NEAREST) && !state.mipmapGenerated) {
if (state.minFilter != GL.NEAREST && state.minFilter != GL.LINEAR && !state.mipmapGenerated) {

GL.generateMipmap (GL.TEXTURE_CUBE_MAP);
GLUtils.CheckGLError ();
Expand Down
2 changes: 1 addition & 1 deletion openfl/display3D/textures/Texture.hx
Expand Up @@ -175,7 +175,7 @@ import haxe.io.Bytes;

if (!state.equals (__samplerState)) {

if ((state.minFilter == GL.LINEAR_MIPMAP_LINEAR || state.minFilter == GL.NEAREST_MIPMAP_NEAREST) && !state.mipmapGenerated) {
if (state.minFilter != GL.NEAREST && state.minFilter != GL.LINEAR && !state.mipmapGenerated) {

GL.generateMipmap (GL.TEXTURE_2D);
GLUtils.CheckGLError ();
Expand Down

0 comments on commit 2054292

Please sign in to comment.