-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange orders of this tutorial #28
Comments
storage buffers are simpler than vertex buffers and index buffers. Compare the code, it takes many more lines of code to use vertex buffers as you have to describe their shape to the API. With a storage buffer you just declare a struct. With a vertex buffer you declare a struct but every field needs a location and then in code you also have to describe the struct to the API when creating a render pipeline
As for why do we have vertex buffers, the main reason is they are older than storage buffers and on older GPUs they are faster. Newer GPU don't have vertex buffers, they are emulated in code. You can find many articles saying we should get rid of vertex buffers. Here's one. https://wickedengine.net/2017/06/05/should-we-get-rid-of-vertex-buffers/ Often this is described as "vertex pulling". https://www.google.com/search?q=vertex+pulling It's also more flexible. If you wanted to write a vertex shader that referenced other vertices you can with storage buffers, you can not with vertex buffers. As for why the order, as it says at the top, they're simpler. The order is simplest to most complex. In particular, going from uniform buffers to storage buffers is a tiny change which you can see right at the top of the article As for uniform buffers before vertex buffers, again, they are easier then vertex buffers and they are arguably more important than vertex buffers. Shaders are just functions, functions need inputs. Uniform buffers are the most common way to provide inputs. They're used in all 3 types of shaders, vertex shaders, fragment shaders, compute shaders. Vertex buffers are not, they are only used in vertex shaders. As an example, there are no vertex buffers referenced on this entire site: https://shadertoy.com but there are uniforms. Same for this site: https://vertexshaderart.com. |
Thank you for your explanation! That really convinced me from the simple to complex perspective you described. Yet, I think this sentence definitely needs to be added to one of the three materials to explain the relationship between these three buffers and the course arrangement 👍🏻 |
Sorry I am a newbie
For one's intuition, we should first talk about
vertex buffer
andindex buffer
, thenstorage buffer
, and finally theuniform buffer
. This is because vertex buffers are the simplest one. Then may followed by "globally available" storage buffers, and finally special storage buffer: uniform buffers.Now the order is very strange, after reading those buffers, I am very confused, and even went to look up why we need vertex buffers when we have uniform buffers - I don't understand why this ordered?
The text was updated successfully, but these errors were encountered: