Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

PreFabs - load question

Discussion in 'Editor & General Support' started by MrSweet, Feb 16, 2008.

  1. MrSweet

    MrSweet

    Joined:
    Jan 19, 2007
    Posts:
    143
    Hi all

    Is this correct?

    If I have say a 5k mesh and make this a prefab and duplicate 10 times does this get loaded x10 into the card or once?

    Is it faster to use 1 prefab x10 up or 1 mesh dup x10 time?

    Does it make a difference?

    Thanks

    Andy
     
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    If they are all using the same mesh asset, then only one mesh will be uploaded to the graphics card (except for the case when the object will use different scale).

    Of course when they are rendered, then 10 objects have to be drawn in any case, so mesh vertices will be transformed 10 times by the graphics card (but all of them will use the same mesh uploaded to VRAM).
     
  3. MrSweet

    MrSweet

    Joined:
    Jan 19, 2007
    Posts:
    143
    cheers, so a faster and better way to build a layout?
     
  4. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    So the moment we change the scale settings in the inspector, the mesh takes twice as much space? (taking into account one entity already exists in the scene at default scale)

    Would that be true also if we scale an instantiated item via scripting? Are there any shortcuts here?

    Thanks
    AC