opengl - 如果 GLSL 中的格式限定符是 r32f,imageLoad() 函数将返回什么?

标签 opengl

我知道如果设置格式限定符 rgba32f,当调用 imageLoad() 时,我得到一个 vec4。如果我设置格式限定符 r16ui,我会得到什么? Wiki 指定该函数仍然返回一个四分量值,该值的每个分量究竟是什么?

最佳答案

对于其他三个组件,您将获得 0,0,1。

这是规范所说的:

Texture Image Loads and Stores

... Loads always return a value as a vec4, ivec4, or uvec4, ... Data are converted to/from the specified format according to the process described for a TexImage2D or GetTexImage command ... Unused components are filled in with (0,0,0,1) (where 0 and 1 are either floating-point or integer values, depending on the format).

关于opengl - 如果 GLSL 中的格式限定符是 r32f,imageLoad() 函数将返回什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67249129/

相关文章:

c++ - Mac 中的 OpenGL ARB 函数

c++ - 在 Qt OpenGL 中制作移动的二维对象

opengl - 什么是使用 OpenGL 的纹理下采样(缩小)?

c++ - 如何在 Cygwin 中使用 OpenGL 和 GLUT

opengl - 未明确指定绑定(bind)点索引的多个 UBO

c++ - OpenGL - 对象轮廓

opengl - 关于使用 OpenGL 模型 View 矩阵和矩阵变换的说明

两个着色器之间频繁交换的 OpenGL 性能开销

c++ - OpenGL 奇怪的顶点着色器问题

c++ - fatal error : GL/gl. h: 没有那个文件或目录