Update for version 0.0.20 (V0.0.20 - Migration to U2020.1.3 Entities 0.14)
This is rather technical
I undertook rather massive for me edeavour, past few days, which where heavy on that subject.
Decided to port project from Unity 2020.1.1, to Unity 2020.1.3, which was rather smooth transition, but I can not say the same, about porting Entities 0.3 to 0.14. This is halve year gap between entities releases, but followed by rather large volume of changes.
Migration to Unity 2020.1.3
Tons of hiccups on the way. Porting directly to 0.14 wasn’t rally working for me. Too many packages differences.
Initially I have created new DOTS project, to se if things working fine in Unity 2020.1.3 and 0.14. Built few basics systems. So that part went smooth.
Also this thread about packages, came with help
Entities Upgrades
As next aim, I decided do it my project upgrade in steps. At least until entities version 0.9.1. I was migrating and updating every Entities 2 versions.
Some changes to libraries were concerned around Core RP, Hybrid Renderer, Unity Physics and other DOTS related packages.
In settings I had to change .Net standard 2.0 to .NET 4.
On C# side, I was using for example IJobNativeMultiHashMapMergedSharedKeyIndices, which is now depreciated.
The replacement I undertook, was based on using
NativeMultiHashMap<int,int> dic=xxxx;
var withDuplicates= dic.GetKeyArray();
withDuplicates.Sort();
int uniqueCount = withDuplicates.Unique();
I derived own methods and jobs based on that. Quite happy so far.
See this thread
I discuss later there, about performance of this approach and the advantage of using in jobified burst.
I have created my simple performance testing script.
Other changes where in naming changes, related to IJobChunk (Entities 0.12),
I.e. ArchetypeChunkComponentType changed ComponentTypeHandle.
See this chanel log for more details
https://docs.unity3d.com/Packages/com.unity.entities@0.14/changelog/CHANGELOG.html
EntityCommandBuffer replaced wording toConcurent intto parallel.
There were also other lesser changes, but also important to implement.
What I hope to gain from it
Well of course staying with more up to date packages. Hopefully having less suffering later
With Entities 0.14 I will be able use ShaderGraph experimental properties in conjunction with corresponding to shader Entity Component. I was looking long time for this feature. Hybrid Renderer V2 subject.
https://docs.unity3d.com/Packages/com.unity.rendering.hybrid@0.8/manual/index.html#using-hybrid-renderer-v2
At this point, I just did some test on the new scene. Yet to modify my current project, to be compatible with this feature. Until then, when I used Shader Graph, I generated the after changes, added / modified the relevant lines of generated shader code, to be able work with DrawMeshInstantiated and material properties.
I hope to be able reduce of use DrawMeshInstanced, and be constrained by batch limit of 1024.
Sure there is DrawMeshInstancedIndirect, but wasnt able to marry both ShaderGraph with it.
So that should hopefully allow me gain quite bonus point.
Unless I will hit some performance snags, as I had with previous DOTS Mesh Rendering V2.
Thats so far for now in brief.
Next
I want to incorporate Hybrid Renderer V2 with ShaderGraph experimental properties and test its performance with my lifeforms entities. Replace most related entities to DrawMeshInstanced if I can.
The only downside, I have nice graphics filtering, based on DrawMeshInstanced. So I need find alternative way. Maybe with shader properties itself. Or upcoming enable / disable entities? Will see …