Does OpenGL support Layout Binding like Vulkan?
Opened this issue · 5 comments
Jusk like:
layout (binding = 0) uniform sampler2DArray sampler;
layout (binding = 1) uniform UBO
{
mat4 model;
vec4 view;
} ubo;
Yep, see https://www.khronos.org/opengl/wiki/Layout_Qualifier_(GLSL) in the Binding Points section. This is core since OpenGL 4.2.
@JoeyDeVries Thanks for your responding.
So webgl2/opengles 3.0 cannot support the binding ?
And another question:
Opengl has the max bindtexture numbers : 32.
How can I use unlimited textures like vulkan in OpenGL?
Not sure on WebGL2/GLES3.0. You'll have to look that up.
You can put multiple textures in one texture (like they do for sprite animation), or use the (more recommended) 2D texture array approach.
So is there any idea about 3D texture arrays?
2D texture array you can basically see as a 3D texture with lots of 2D slices. Not sure a 3D texture array exists if that's what you're specifically looking for, but if you need more than 32 3D textures you'll probably blow up your GPU memory anyways so don't think there's too many use cases for that.