Correction of the opengl lens texture offset by calling the opengl function?

How can I change the lod offset by calling the opengl function? I don’t like the default settings, miplevels change too often, and the surrounding land looks ugly.

I could not find any codes to do this, each topic dealt with some external programs that do the job ...

Edit: these are my texture settings:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
+3
source share
2 answers

Using:

glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, bias);

More details here: http://www.opengl.org/sdk/docs/man/xhtml/glTexEnv.xml and there: http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_lod_bias.txt

EDIT:

, . GL_TEXTURE_MAG_FILTER :

  • GL_NEAREST
  • GL_LINEAR

GL_LINEAR .

GL_TEXTURE_MIN_FILTER GL_NEAREST_MIPMAP_NEAREST , mipmaping ( mipmap, , mipmap , ).

, GL_NEAREST_MIPMAP_LINEAR .

GL_LINEAR_MIPMAP_LINEAR , mipmaps (mipmap N N + 1) , mipmap N, .

GL_LINEAR_MIPMAP_LINEAR .

+10

, , , miplevel, ... ?

, , "lod bias"..., miplevel,

+1

Source: https://habr.com/ru/post/1725309/


All Articles