【问题标题】:glTexSubImage2D with target: GL_TEXTURE_1D_ARRAYglTexSubImage2D 目标:GL_TEXTURE_1D_ARRAY
【发布时间】:2023-01-12 23:46:24
【问题描述】:

(同样可以要求:“glTexSubImage3D with target: GL_TEXTURE_2D_ARRAY”)

我理解正确吗?

如果你有分配:

int levels = 1;
int width  = 5;
int layers = 3;
glTexStorage2D(GL_TEXTURE_1D_ARRAY, levels, GL_R8, width, layers);

并上传:

int level = 0; // mipmap-level
int x_off = 2;
int y_off = 1;
int width = 3;
int height = 2;

byte[] data = {255, 255, 255, 255, 255, 255}; // (3 * 2) 6 pixels

glTexSubImage2D(GL_TEXTURE_1D_ARRAY,level,x_off,y_off,width,height,GL_RED,GL_UNSIGNED_BYTE,data);

“绿色插槽”是否会成为转移的受影响像素?

底行 (y = 0) 是第一个数组。

如果目标是:GL_TEXTURE_2D

【问题讨论】:

    标签: opengl


    【解决方案1】:

    是的,你没看错。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-03-22
      • 1970-01-01
      • 1970-01-01
      • 2014-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-20
      相关资源
      最近更新 更多