Search Unity

(ECS+LWRP) Meshes disappear on camera position/rotation change

Discussion in 'Entity Component System' started by andrew-lukasik, Mar 27, 2019.

  1. andrew-lukasik

    andrew-lukasik

    Joined:
    Jan 31, 2013
    Posts:
    249
    Hi,
    Can somebody guess what may be happening here? Gif below presents the problem (watch yellow spheres):

    https://i.imgur.com/Y9WIJwD.gif


    Meshes disappear and show up again in specific camera angles or positions.
    Also removing some entities while program is running makes some some of them appear again. It happens in non random but linear/chronological order of their creation I think.

    Im using hybrid ECS+LWRP here. These spheres are using LW/Lit shader (GPU instancing enabled but disabling it changed nothing). What's interesting this is not happening when I change their material to built in "SpatialMappingWireframe"

    Any thoughts or pointers on this?
     
    Last edited: Mar 28, 2019
    Opeth001 likes this.
  2. Singtaa

    Singtaa

    Joined:
    Dec 14, 2010
    Posts:
    492
    May be a side effect of the new SubScene+Conversion workflow. If you are using preview 26 or later, does reverting back to entities preview24 fix your issue?
     
  3. andrew-lukasik

    andrew-lukasik

    Joined:
    Jan 31, 2013
    Posts:
    249
    That would be really strange since I don't have any SubScene here nor use any Conversion utility yet.
    Unfortunately to know 100% I can't easily revert to p24 because my codebase breaks down under this version
     
  4. Singtaa

    Singtaa

    Joined:
    Dec 14, 2010
    Posts:
    492
    Yeah, you may not need to actively use SubScenes to experience side effects inside of SubSceneLiveLinkSystem. Again, I'm not 100% sure it's the case. But you can try to filter it out to test if it helps.

    Code (CSharp):
    1. public class CustomBootstrap : ICustomBootstrap
    2. {
    3.     public List<Type> Initialize(List<Type> systems)
    4.     {
    5.         return systems.Where((t) => t.Name != "SubSceneLiveLinkSystem").ToList();
    6.     }
    7. }
    You can refer to this post for context: https://forum.unity.com/threads/fixed-in-p29-bug-ecs-disables-drawmeshinstanced.641320/
     
  5. surits14

    surits14

    Joined:
    Jan 22, 2018
    Posts:
    22
    @andrew-lukasik did yu fix it...?

    I am experiencing a similar problem in a very similar scene condition. Let me know, please. Thanks
     
  6. andrew-lukasik

    andrew-lukasik

    Joined:
    Jan 31, 2013
    Posts:
    249
    Hi @surits14 . I honestly don't know. It fixed itself somewhere between new Unity versions OR I fixed it somehow without realizing when/how exactly.
    If you're using older ECS code then make sure it's more up to date ie.: You're using IConvertGameObjectToEntity workflows, latest entity packages etc.