Search Unity

High Poly 32 bit index mesh weirdness

Discussion in 'General Graphics' started by owen_proto, Nov 26, 2018.

  1. owen_proto

    owen_proto

    Joined:
    Mar 18, 2018
    Posts:
    118
    I have a script that procedurally creates a sphere. I have set that sphere to use 32 bit index format with:

    Code (CSharp):
    1. sphere.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
    "sphere" is my mesh. It works fine in editor where I've taken it up to about 1.5 million vertices:

    https://imgur.com/EyAHQdd

    When I enter play mode the sphere turns into this:

    https://imgur.com/1pyaB3a

    However if I generate the sphere at runtime it has no problem.

    Anyone know what the cause may be? Running 2018.3.0b8, GTX 680
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    can you post your full script?
     
  3. owen_proto

    owen_proto

    Joined:
    Mar 18, 2018
    Posts:
    118
    I discovered the problem! There was a code path leading to generating the sphere mesh that defaulted to 16 bit index buffers and going back and forth between the two made the sphere unhappy. Thanks for your willingness to help!
     
    richardkettlewell likes this.