- Home /
advice for computing and rendering many, many line segments ?
I'm thinking about a unity port of my iOS app "Prism HD".
The fundamental rendering task each frame is this:
Compute a whole bunch of line segments to simulate optical effects. " many" = maybe 10,000 or so. each segment has x & y data plus a u & v texture coordinate. for what it's worth, the simulation is 2D, not 3D.
Draw them.
so i have two questions:
if C# turns out not to be fast enough to crunch 10,000 rays at 60Hz, would i be better off doing the math in C (that's how i do it in iOS), or should i learn how to use compute shaders ? I'm only interested in targeting iOS, Android, and maybe desktop, so i don't need it to work in WebGL. There's not a lot of computer shader examples w/ unity.
how do I draw these things ? I'm super lazy. CommandBuffers seem pretty mesh-oriented, and this isn't a mesh. I'd prefer not to convert each line segment to a quad, because that quadruples the number of vertices which need to go over the bus. Again, is a shader the way ? I've never stepped outside of the fixed-function pipeline.
looks perfect, except you need to make a GL call for each vertex. ie you can't pass a VertexBuffer. otoh, 10,000 line segments render just fine in IDE and also in WebGL. if i could keep this all in C# that would be awesome.
$$anonymous$$aybe take a look at Vectrosity on the Asset Store.
Your answer
Follow this Question
Related Questions
Shader limits on iPad 1 Answer
GL.LINES renders in a single quadrant of the screen 0 Answers
Fine lines on assets shimmer/flicker while moving 1 Answer
Make custom input devices available to scripting via "Input" 2 Answers
,Drawing 100 000+ cubes 1 Answer