Full Example?
Now that the burst compiler is standard with the new 2019 version of Unity, would it be possible to provide a demo scene with everything set-up to try? That would be very helpful. I haven't been able to find other examples of Unity ECS lines. Thanks.
Hi, the out of preview Burst refer to the code section [BurstCompile] which you can put on the job struct. The standardized thing is you can reliably convert self-contained code to good assembly. Though, some features like math accuracy and bursted method instead of bursted struct are still missing. Plus, the out of preview status is not related to things on ECS side. For example EntityCommandBuffer still couldn't be burst compiled.
It doesn't mean that Entities package API is standardized. In fact Entities is planned to be stable in 2022 or something, from Unite show. The problem of this repo is that it was made way before "the big deprecation" of ECS in around preview 28-30 where [Inject] are all gone, ComponentDataArray disappeared, etc. and not yet fixed for the latest preview.
So what am I waiting for now that the big deprecation had since long passed? No one could never be sure when ECS is going to make a big move again due to its preview status.
But one thing related to line rendering is the Hybrid Renderer. That package is missing important thing that is material property (want it for line color). The new BlobAsset is ideal for storing line meshes instead of my current SCD-based approach. And game object conversion workflow could be really useful, imagine you could change normal LineRenderer to mine seamlessly. You see there are a lot of things that deprecates the current repo and I am not sure when to begin renovating this again. : P
Ah I understand. I am hoping for a good solution for rendering large numbers of lines that change every single frame, as the current solution I use requires setting the endpoints of many LineRenderer objects, which doesn't scale well. My understanding was that ECS might help, but truthfully I find it a little confusing to set-up, which is why I was hoping for a scene to load and try. However, since you say that whatever you have written is already deprecated, it makes sense that you wouldn't want to keep rewriting everything. However, I suppose that for myself, it would be completely fine to stay with one version of Unity for a single project. Assuming I lock-down the Unity version to avoid deprecation and to allow me to introduce hacky code, do you know of how I might achieve efficient line rendering of separate line segments with as few objects as possible, maybe using ECS to update the points every frame? It would be great if you could point to some resources. Thanks.
If you lock into the current preview 33 that was just released, I think still for efficiency you will not be using LineRenderer but generate a mesh for use with RenderMesh, which I did in the package.
But if you want to go hybrid and try to alter LineRenderer's point every frame then you could, but keep in mind that its GetPoints API is not accessible from jobs, plus modified points must be set via SetPoints which is also main thread. I am not sure about performance of that.
What you could do more efficient in that case is moving the root transform of the LineRenderer via Translation, then have a system to copy that back to mono Transform. But other than moving each segment is a pain, I guess most bottleneck is the rendering. (Which to bypass, you will not use LineRenderer)
You could look at that hybrid approach I talked about here. I moved just the root on thread, but each line segment wiggles on the main thread because that's what LineRenderer allows.

Oh I see, and thanks for the example. In that case, should I really be generating my own line meshes / using instancing? I'm not entirely sure what the standard for dynamic lines is.
I am not sure about standards either. But looking from LineRenderer, ideally lines should not be just begin-end point because you usually want to connect lines, and in that case you will have duplicated data at every joints. Even OpenGL line drawing command you could chain the line.
I used 1 entity per 2 float3 (start-end) because it was simpler. And I think rendering is the real bottleneck so I think duplicated coordinate shouldn't be a big issue.
And I (guess) connected list of points may ended up slower in ECS (?), since the unit/size of data now vary and ECS is good with predictable and repetitive work. We need to query all lines, which must be iterated through n points. Compared to query all lines which have fixed 2 points and do the same thing for all.
For the generating mesh and instancing, basically it is what this repo did.. so a rectangle mesh is generated once, which ECS rendering system could draw instanced. The line gets thicker or longer with scaling on 2 dimension, and the rotation is used to rotate to face the camera in billboard style and rotate for direction that results from destination minus origin.
Also I tried open the project just now on preview 33 but get a tons of error from internal Unity systems, not sure what's going on.
Hi, I just finished updating it for preview.33. There is a demo scene which produce 3 lines in edit mode with component proxies.
Great! Thanks for looking into this.