Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Not all entities rendering

Discussion in 'Graphics for ECS' started by mk1987, May 12, 2021.

  1. mk1987

    mk1987

    Joined:
    Mar 18, 2019
    Posts:
    53
    Hi there,

    Im having a problem where im procedurally generating a asteroid field and some asteroids are rendering whilst others are not.

    The only difference between each asteroid is the size and rotation, the shader settings are left unset. Im using monobehaviour to instantiate from a base entity, it uses a master sphere collider to define where the asteroids need to be inside, and then various box and sphere colliders to identify where no asteroids should be placed. The system works fairly slickly to generate a random/repeatable asteroid field, however at a point designated approximately -35,000 to -40,000 in X axis anything past this point is not rendered. The entity exists as per the other ones but nothing is shown. I've noticed if i move my asteroid belt instantiation point anywhere else where it does not go inside the 40000 it renders fine.

    Is this something anyone else has come accross.

    Thanks for any help!

    Cheers
    Mark
     
  2. mk1987

    mk1987

    Joined:
    Mar 18, 2019
    Posts:
    53

    Asteroid field.PNG
    Above asteroid field partially constructed due to cropping issue.
    Asteroid field2.PNG

    Above asteroid field if i move translation randomly in more positive X direction, fully complete since i am above -33500

    asteroid3.png
    The above is just to signify that my procedural code for the belt has worked and created a entity at the location highlighted, unfortunately it is just not visible, I've used this script for the past 6 months at least in entity format without issue until i noticed this cropping issue.

    The negative x rendering cut off seems to occur at approximately ~(-)33500, which is very close to 2^25 (not sure if this is significant?). I moved it to a similar position but in -33500 in z and y but that appears to be fine and it renders with no issue.

    Any help would be much appreciated.

    Many THanks
    Mark
     
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,753
  4. mk1987

    mk1987

    Joined:
    Mar 18, 2019
    Posts:
    53
    Hi @tertle ,

    Its Hybrid Renderer V2 and the asteroids are rendered using a GameObjectConversionUtility gameobject including LOD system which for most cases works all the time! Judging by how the border is very much a square bounds it looks very much like something hardcoded as suggested in that post. If thats the case it would be good if they could define the upper/lower bounds of the rendering.

    edit: In fact im sure thats case now, i just gave the asteroids a 100m/s motion in positive x and as the asteroids move beyond -335xx they are progressively rendered. I might experiment to find where the culling limits are in mean time and adjust my game accordingly.
     
    Last edited: May 13, 2021
  5. Fribur

    Fribur

    Joined:
    Jan 5, 2019
    Posts:
    132
  6. SebastianAaltonen

    SebastianAaltonen

    Unity Technologies

    Joined:
    Feb 21, 2020
    Posts:
    112
  7. mk1987

    mk1987

    Joined:
    Mar 18, 2019
    Posts:
    53
    Thanks both, I updated to preview 43 but as listed in the link the value "p.Distances[i & 3] = 32786.0f" still exists in the latest version (it appears that part of FrustrumPlanes.cs is unchanged or the change didnt update), i adjusted the value to something larger and that fixes the issue.
     
  8. SebastianAaltonen

    SebastianAaltonen

    Unity Technologies

    Joined:
    Feb 21, 2020
    Posts:
    112
    There was a issue in the package release. 0.11.0-preview.44 is releasing soon with this fix. I will inform when this happens.
     
  9. SebastianAaltonen

    SebastianAaltonen

    Unity Technologies

    Joined:
    Feb 21, 2020
    Posts:
    112
    0.11.0-preview.44 is released! Includes the missing X axis culling fix. Thanks for reporting this missing fix!
     
    iamarugin likes this.