Search Unity

DOTS Preparation

Discussion in 'Entity Component System' started by DanielRiches, Jun 9, 2021.

  1. DanielRiches

    DanielRiches

    Joined:
    Nov 23, 2019
    Posts:
    166
    Using Unity 2021.1.10f1
    Using HDRP 11.0.0


    Hello all,

    I wondered if I can get some advice, currently I see Unity has said DOTS wont be compatible with 2021 for a while, so I'm going to have to wait to implement it, but I need some advice on how to set up my project to utilize it when it's available, as I don't want to have to edit all my assets once it finally works.

    I'm planning a hybrid approach, I'm still using standard Rigidbodies and colliders for example, but I was considering using ECS for specifically the rendering part on static objects using a ConvertToEntity script.

    Currently my object structure is below, the renderer uses materials with GPU-Instancing enabled and all other components are on a duplicate object minus the renderer component.



    The duplicate below uses the same mesh filter and applies colliders.



    The parent is what I use to scale the object overall, so the renderer and components can remain separated so it doesn't convert the components to entities also.

    I read somewhere there's a component in ECS for Occlusion Culling too which would get added to the renderer also

    Also I was wondering how ECS deals with material shaders that use vertex displacement? like foliage on a tree that moves or water. If it converts to entity will the shader still work?

    Is this a valid approach? I want to nail my structure properly before proceeding.

    Thanks all.
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,270
    No one knows what will be required to convert a project to use Entities by the time it syncs up with a version newer than 2020.3 LTS. No one even knows when the next version of Entities will even drop.

    If you want to use Entities, use 2020.3. If you don't, don't try to consider it because whatever suggestions we may come up with will almost certainly be invalidated when that time comes.

    But I guess there are some basics that seem very likely usable for you. Shaders made in shader graph will probably work. Shaders written by hand probably won't. And if your static GameObjects are nothing but rendering components and aren't interleaved with your simulation GameObjects and Components, that will likely help.