Search Unity

DOTS Hybrid renderer issue : All transforms are reset to defaults in builds

Discussion in 'Graphics for ECS' started by PhilSA, Oct 8, 2019.

  1. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    I have a project with the following characteristics:
    • Unity 2019.3b4
    • HDRP 7.0.1
    • Hybrid Renderer 0.1.1
    • Entities 0.1.1
    • DOTS Windows Platform package
    • Using shaders with DOTS instancing enabled
    • Using SRP batcher
    • Default Graphics API, on Windows
    When I play in-editor, everything works as expected. But when I play in a build, all transforms are always reset to defaults (all characters, level geometry, projectiles, etc... are at (0,0,0) with identity rotation and (1,1,1) scale, and they never move)

    Even weirder: it seems that all objects are at the correct position on the very first rendered frame, and then they all get reset to default pos/rot/scale

    Anyone knows what might be going on?
     
    Last edited: Oct 8, 2019
    JesOb likes this.
  2. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    482
    I have the same issue. Would like to know answer too
     
  3. desertGhost_

    desertGhost_

    Joined:
    Apr 12, 2018
    Posts:
    260
  4. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    Disabling srp batcher and removing DOTS windows platform didn't solve it

    The issue is present in URP 7.1.2 as well
     
    Last edited: Oct 8, 2019
  5. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Your linker is fine? Maybe some code stripped in IL2CPP build, but linker issues should be fixed in 2019.3... But you can try disable code stripping for sure, or fill link.xml
     
  6. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    PhilSA and Singtaa like this.
  7. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    Whoah, correction:
    Disabling SRP Batcher in URP 7.1.2 solves it!

    It's just when I tried disabling it via script on Start in HDRP that it didn't work
     
    desertGhost_ likes this.
  8. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    I still get issues if I use the legacy renderer and the default result from ConvertToEntity(just tried a build with 19.3b6)
     
  9. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    SRP Batcher issue should be fixed in 19.3b6
     
    PhilSA likes this.
  10. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    Tested in b6 with SRP Batcher on, and the problem is still there unfortunately.

    However, kinda off-topic but I can't believe how impressive DOTS performance is, especially in a build. 40,000 "zombies" with basic physics and AI, implemented completely naively without optimizations, running at 60fps on an old-ish 4core/4threads CPU from 2014
    https://i.gyazo.com/141cded3a8eb68de7c5db87aa6952413.mp4
     
    Last edited: Oct 9, 2019
    pal_trefall, ysxdead, Krajca and 4 others like this.
  11. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    ok strange, might also need next hybrid renderer update. In any case, we hit the exact issue in dots shooter and fixed it.
    Lets see again after next dots / hybrid renderer release.



    Good to hear that its working well for you...
     
    KonstantinChe likes this.
  12. DaMitch

    DaMitch

    Joined:
    Feb 6, 2013
    Posts:
    29
    Hi,

    I experienced this bug too, and disabling the SRP Batcher did the trick. (with unity 2019.3.0b12 + entities 0.2 + hybrid rendering 0.2 + universal render pipeline 7.1.5).
    But I managed to finally make it work with the SRP Batcher and understand the source (or at one of the possible sources) of the issue here.

    I noticed that this bug happened only when I was using assets (Mesh + Materials) loaded using addressables, it worked well when I used assets serialized somewhere in the scene.

    So I cleaned the addressables, rebuilt them and it worked! I don't know if this happened because I changed the version of unity since the last addressable build or if it was because I updated many packages (including universal render pipeline, Entities, Physics, Hybrid Rendering, Jobs and Burst). I was in fast mode with the addressables, I guess that's why it worked perfectly in the editor.

    Hope it helps
     
    Last edited: Nov 29, 2019
    PhilSA likes this.
  13. siggigg

    siggigg

    Joined:
    Apr 11, 2018
    Posts:
    247
    URP is not supported with Hybrid renderer atm, you need to use HDRP :(
     
  14. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    122
    I had the same problem here. Tried a lot of different approaches, nothing worked. Log was empty, and Entities were just rendered in the Editor, not in the Build.
    I am using the newest packages:
    - Unity 2019.3.0f3
    - URP 7.1.7
    - Entities 0.4.0-preview.10
    - Burst 1.2.0-preview.12

    After disabling the SRP-Batching it worked. (Still my gameobject-light did not enlight the entities, but they are finally visible!)
     
    nicolasgramlich likes this.
  15. Tudor_n

    Tudor_n

    Joined:
    Dec 10, 2009
    Posts:
    359
    This bug is still here.

    Tested on:
    Unity 2019.3.0f6
    Hybrid Renderer preview.11 - 0.3.3
    Entities preview.11 - 0.5.1
    Burst 1.2.1
    URP 7.1.8

    The workaround is still disabling the SRP batcher.
     
  16. StickyMitchel

    StickyMitchel

    Joined:
    Sep 2, 2019
    Posts:
    19
    I came across the same issue when playing around in the Dots Shooter when I tried to add a new item to the mix.
    After a long time I found out that if you disabled the SRP Batcher it will work, however in the case of the Dots Shooter it also broke the animations (?) when more than 2 clients are connected.

    After a bit more testing it seemed that my objects would handle as planned if they had the correct shader on them. Using the default HD Material made them break in builds and reset their transforms. By using one of the Dots Shooter envionment shaders on the items they would spawn at the correct locations (and scale).

    I am not sure why this is or how to fix it properly (I need to read more into what the SRP Batcher does), but maybe this will help others who were struggling like me.