Hello, there is the dilemma:
Is it possible to somehow extract Mesh Insatance or what ever doing the rendering from Unity LineRenderer Component to use it as Pure ECS? Or stick to Hybrid ECS model until LineRenderer component will be implemented in Entities world?
Maybe there is alternative way to generate line spline without GameObjects ?
In advance thank you for your thoughts.
In pure you will not be able to use it. So you have two options stick to hybrid or implement your own line generating solution. Basically, you need to generate a mesh and set it in MeshInstancedRenderer.
Thanks for answer.
I’d also find solution to work with GL directly or use both Pure + Hybrid ECS, just with system which sync or transfers data between some GameObjectsEntities & Entities (It might be useful not only for line renderer).
Once you start using Hybrid, you are loosing best benefits of of Pure ECS. But you can combine of course pure and Hybrid in your project. I would follow as @Micz84 suggested.
Has anyone figured out an easy way to do this yet? The original line renderer component always faces the camera and is great for things like laser beams. It would be really nice to have that functionality again.
I have a shader graph that integrates with DOTS and does this.
That’s cool ,Do you have an example screenshot
@lclemens You can try this Segments package (inspired by older ECSLineRenderer). It’s rather simple to use and line-plotting can be burst+jobified which is good.
Single biggest downside so far: I’m not sure how to get rid of HybridRenderer’s overhead it adds (it’s becoming noticeable above about 10k segments).
You probably could use shader graph, to improve on rendering.
how do you do that? could you share a source to learn about?
I would bite problem from two angles.
But this vid may be good starting point
https://youtu.be/9aOtie1DKCc?t=1745
Jump to 29 min, where video describes shapes nodes of the shader graph. Could be also useful.
https://www.youtube.com/watch?v=9aOtie1DKCc
If just dealing with cubes, I just need common shader for each cube, with own texture, and properties.
Basically you got material, which represents wired mesh of the cube. And switch transparency / texture in shader.
You will need to look for MaterialProperty keyword. There are some good post in the forum, explaining it well.
Something like that.
[MaterialProperty("_Alpha", MaterialPropertyFormat.Float4)]
public struct ShaderAlphaComponent : IComponentData
{
public float f ;
}
I did something like that with both cubes and 3D hexes.
WOW Thanks a lot!
That segments package looks pretty neat, however, it looks to me like it’s just for doing a simple segment. The old linerenderer could do things like this:
Where the “line” is actually a plane that always faces the camera and that plane can have a material applied to it and animated.
Looks like very nice effects.
You could apply / modify shader, to animate similar effect.
Regarding facing to camera, you would need rotate segment along its own axis toward the camera.
I am sure @andrew-lukasik could apply such, if wanted / had time / etc.
I wish I could take credit for those laser-beam effects, but I just screenshotted them. There are a bunch off effects assets on the asset store that use them and there are a few youtube tutorials about how to make them using a LineRenderer.
I attempted to make a half-ass one that uses two perpendicular intersecting transparent planes:
But it doesn’t look nearly as good because DOTS doesn’t have anything like the old LineRenderer.
Unfortunately with dots, we are left to do plenty of our own solutions.
At least for time being.
Just wanted to ping this thread - has anyone found a good solution for an ECS line-renderer that can be animated yet?
It’s on my backlog of things to implement, but as with all things I do, there’s lots of competing priorities. However, if animating a general mesh is sufficient for your use case, I have this: https://github.com/Dreaming381/Latios-Framework-Documentation/blob/main/Kinemation%20Animation%20and%20Rendering/Dynamic%20Meshes.md