Update an uniform variable in several shader programs at once

ⅰ亾dé卋堺 提交于 2019-12-03 06:53:13

In some forum discussions I've read that [...] is much slower than glUniform* call.

So what if it is (assuming that there is evidence that it even is, of course)? You only do that once per frame, while glUniform calls are one per modified program.

I'd go with uniform blocks (always use std140 by default) for any shared data. There's a fixed cost to updating them, while there's a variable cost to updating the others.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!