1

I'm currently experimenting with compute shaders in unity and I'm trying to make a cloth simulation, I would like to draw the cloth using lines and points. But I cant find any other way than stitching something together using ui elements, a spearate line renderer for each line. or writing a separate compute shader for the lines. And neither of those seem too appealing for me. Is there any faster or simpler method to do this? Since Im handling thousands of lines.

Reezardo
  • 33
  • 4
  • 1
    If this is purely for *experimentation* to prove out some other code, then Debug.DrawLine is the easiest implementation for drawing lines. However, I suspect it's not particularly efficient when it gets to thousands of lines, and it's only visible in the editor scene view (after all, it's a debug function). Otherwise, depending on what you want to achieve, the most performant solution might be to update the verts and tris in a MeshFilter's mesh and use a simple custom shader to render wireframe only. If the lines can be calculated on the shader without a mesh, that would be fastest. – normalcherie Sep 08 '21 at 15:24

0 Answers0