Skip to content

Commit

Permalink
GL: Re-enable mipmaps for thin3d textures.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Aug 18, 2020
1 parent 06ab215 commit 06a5289
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ext/native/thin3d/thin3d_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,9 @@ class OpenGLTexture : public Texture {
void Bind(int stage) {
render_->BindTexture(stage, tex_);
}
int NumMipmaps() const {
return mipLevels_;
}

private:
void SetImageData(int x, int y, int z, int width, int height, int depth, int level, int stride, const uint8_t *data, TextureCallback callback);
Expand Down Expand Up @@ -1047,8 +1050,7 @@ void OpenGLContext::ApplySamplers() {
GLenum magFilt = samp->magFilt;
GLenum minFilt = tex->HasMips() ? samp->mipMinFilt : samp->minFilt;
renderManager_.SetTextureSampler(i, wrapS, wrapT, magFilt, minFilt, 0.0f);
// TODO: Improve this to allow mipmaps. We don't care about those right now though for thin3d stuff.
renderManager_.SetTextureLod(i, 0.0, 0.0, 0.0);
renderManager_.SetTextureLod(i, 0.0, (float)(tex->NumMipmaps() - 1), 0.0);
}
}

Expand Down

0 comments on commit 06a5289

Please sign in to comment.