当前位置:网站首页>API learning of OpenGL (2004) gl_ TEXTURE_ MIN_ FILTER GL_ TEXTURE_ MAG_ FILTER

API learning of OpenGL (2004) gl_ TEXTURE_ MIN_ FILTER GL_ TEXTURE_ MAG_ FILTER

2022-07-06 10:36:00 hankern

Set texture filtering mode .

1、GL_TEXTURE_MIN_FILTER

GL_TEXTURE_MIN_FILTER Value GL_NEAREST GL_LINEAR GL_NEAREST_MIPMAP_NEAREST GL_LINEAR_MIPMAP_NEAREST GL_NEAREST_MIPMAP_LINEAR GL_LINEAR_MIPMAP_LINEAR, Default GL_NEAREST_MIPMAP_LINEA

2、GL_TEXTURE_MAG_FILTER

GL_TEXTURE_MAG_FILTER Value GL_NEAREST GL_LINEAR, Default GL_LINEAR.

Used when sampling from texture “ Detail level ” When the function determines that the texture should be imaged , Will use “ Texture magnification ” function . It sets the texture magnification function to GL_NEAREST or GL_LINEAR.GL_NEAREST Often than GL_LINEAR faster , But it can generate texture images with sharper edges , Because the transition between texture elements is not so smooth .GL_ texture _MAG_ The initial value of the filter is GL_ linear .

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

原网站

版权声明
本文为[hankern]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131709023744.html