At first I thought that ComputeBuffer
's could only be used in compute shaders and that GraphicsBuffer
's could only be used in materials. But Unity provides overloads for setting ComputeBuffer
and GraphicsBuffer
to both compute shaders and materials. So how do they differ?
\$\begingroup\$
\$\endgroup\$
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
1
It seems that they differ in the type of data that they can hold. A GraphicsBuffer can be used for vertex and index buffers, while a ComputeBuffer can be used for any arbitrary data, which is mostly needed for compute shaders.
-
1\$\begingroup\$ Don't forget to mark this answer as Accepted if it solved your problem. \$\endgroup\$– DMGregory ♦Commented Mar 10, 2022 at 11:45