本文介绍了居民纹理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是OpenGL中的驻留纹理?
我正在阅读的书的作者没有解释驻留纹理背后的想法,以及他们真正做什么。

What are resident textures in 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.

帮助我理解这个主题。
他基本上说我想要所有的纹理都是常驻的,而非常驻的纹理是坏的。 $ b

Help me understand this subject.

推荐答案

驻留纹理是仍然存储在活动内存中的纹理。换句话说,OpenGL不需要为了想要变为活动的纹理而打乱内存空间。

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:

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

有关该函数的更多信息:

More information on that function here:glAreTexturesResident

和详细文章这里:
了解和使用OpenGL纹理对象

这篇关于居民纹理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 08:24