简体   繁体   English

在OpenGL中绑定超过MAX_TEXTURE_UNITS个纹理

[英]Bind more than MAX_TEXTURE_UNITS textures in OpenGL

I am programming a 2D Game Engine, I am using OpenGL (pure, I am not using glut or any other). 我正在编程2D游戏引擎,我正在使用OpenGL(纯,我没有在使用过剩或其他任何东西)。

If I print this macro: MAX_TEXTURE_UNITS I get 8, and obviously, when I try to bind more than 8 textures, nothing appear in the render area. 如果我打印此宏:MAX_TEXTURE_UNITS我得到8,显然,当我尝试绑定8个以上的纹理时,渲染区域中什么也没有出现。 I was wondering if it is possible to link more than 8 textures? 我想知道是否可以链接8个以上的纹理?

The function I use to bind a texture is glBindTexture(GL_TEXTURE_2D, texID) . 我用来绑定纹理的函数是glBindTexture(GL_TEXTURE_2D, texID)

GL_MAX_TEXTURE_UNITS gives the maximum number of multi-texturing texture units using the old fixed function pipeline. GL_MAX_TEXTURE_UNITS使用旧的固定函数管线给出最大数量的多纹理纹理单元。 If you are looking to get the maximum number of texture units usable on shaders (Eg samplers ), call glGetIntegerv with GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS or GL_MAX_TEXTURE_IMAGE_UNITS . 如果你正在寻找使自己的着色器使用的纹理单元(例如最大数量samplers ),调用glGetIntegervGL_MAX_COMBINED_TEXTURE_IMAGE_UNITSGL_MAX_TEXTURE_IMAGE_UNITS The last one is the preferred value for OpenGL version 3+ and must be at least 16. 最后一个是OpenGL 3+版本的首选值,并且必须至少为16。

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

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