performance - glVertexAttrib 与 glVertexAttribPointer

标签 performance opengl graphics glsl

我正在通读并尝试学习着色器,但我突然对将信息传递到着色器感到困惑。

glVertexAttribglVertexAttribPointer 有什么区别?有不同的时间使用它们吗?它们只是做同一件事的两种不同方式吗?一个提供更好还是更差的性能?

最佳答案

glVertexAttrib 为给定的一组顶点设置属性的

glVertexAttribPointer 为每个顶点设置属性的位置

所以本质上这两个是不同的功能,你不能在速度上比较它们。无论如何,设置属性指针并不是大多数渲染设备的瓶颈。

关于performance - glVertexAttrib 与 glVertexAttribPointer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13603956/

相关文章:

vb.net - 停止在 UserControl 的特定区域引发 Click 事件

html - CSS 链接性能

android - 访问被拒绝查找属性 ro.vendor.hwui.texture_cache_size

c++ - OpenGL 顶点数组对象使用

c++ - 在 3d View 中动态渲染 2d 板

java - Java Graphics 2D 中的背景颜色始终为黑色

sql - Postgres on AWS 过滤器或聚合的性能问题

php - IIS 陷入无限加载循环

c++ - 错误 : 'GL/glfw3.h: No such file or directory' when compiling C++ programs using OpenGL on Linux

graphics - 在 C++ 中以编程方式使用高斯滤波器填充 nxn 矩阵