简体   繁体   English

常驻纹理?

[英]Resident textures?

What are resident textures in OpenGL? OpenGL中的常驻纹理是什么? The author of the book I'm reading doesn't explain the idea behind resident textures and what they really do. 我正在阅读的书的作者并未解释常驻纹理背后的思想及其实际作用。 He basically says that I want all textures to be resident and non-resident textures are bad. 他基本上说我希望所有纹理都是常驻纹理,而非常驻纹理则不好。

Help me understand this subject. 帮助我了解这个主题。

Resident textures are textures that are still stored in active memory. 常驻纹理是仍存储在活动内存中的纹理。 In other words, OpenGL doesn't have to shuffle memory around to make room for the textures that you want to become active. 换句话说,OpenGL不必为了节省空间而为想要激活的纹理腾出空间。

There is an OpenGL function that you can call to see if a texture is active: 您可以调用一个OpenGL函数来查看纹理是否处于活动状态:

GLboolean glAreTexturesResident(GLsizei n, 
const GLuint * textures, 
GLboolean * residences);

More information on that function here: glAreTexturesResident 有关此功能的更多信息,请参见glAreTexturesResident

and A detailed article on resident textures here: Understanding and Using OpenGL Texture Objects 以及此处有关常驻纹理的详细文章: 了解和使用OpenGL纹理对象

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM