英文:
How do you read the vertex buffer in the fragment shader?
问题
我尝试在片元着色器中读取我的顶点数据,以进行一些渲染实验。是否可以这样做,如果可以的话,最佳方法是什么?
我猜想缓冲视图可能是用来实现这一目的的,但我在网上没有找到有关它们的信息,也不确定如何确切地使用它们。
英文:
I am trying to read my vertex data in the fragment shader to try some rendering experiments. It is possible to do this, and if so, what is the best way?
My guess is that buffer views are meant to be used, but I didnt find anything about them online and am unsure how exactly to use them.
答案1
得分: 1
只要实现不禁止将相同的缓冲区用作顶点缓冲区和SSBO(或缓冲区视图,如果您希望以这种方式执行),您可以这样做。只需绑定缓冲区以用作这两种用途。
英文:
As long as the implementation doesn't forbid using the same buffer as a vertex buffer and an SSBO (or buffer view, if you want to do it that way), you can do it. You simply bind the buffer for use as both things.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论