如何在片段着色器中读取顶点缓冲?

huangapple go评论50阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年3月4日 06:16:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/75632308.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定