Search Unity

Mesh Optimization : Is removing Vertices Tangents worth it ?

Discussion in 'General Graphics' started by rob11, May 18, 2022.

  1. rob11

    rob11

    Joined:
    Mar 7, 2017
    Posts:
    59
    Hello, as asked in my title, I was wondering if it was worth it to remove the Vector4 of Tangents data from my meshes. As far as I understand, Tangents are used for normal/bump mapping. If I mesh is never gonna use this, of what use could the Tangents be ? I tested and it lightmaps and gets Realtime lighting properly.

    Since this is a Vector4 of float32, it saves quite a bit of memory. Does Unity gets rid of the Tangents itself at buildtime if they are not used, making this "optimization" useless?

    I know we are not talking about a huge gain, but I am very curious :)

    Thank you !

    ETA picture for reference :

    upload_2022-5-18_8-56-51.png
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,753
    Maybe the “optimize mesh data” option in player settings does it, but since that is unreliable and I have to turn it off, I generally manually disable extra vertex data I do not need.
     
    rob11 likes this.
  3. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
    Optimization is never "worth it" unless you are having performance problems when testing and you've determined that what you are fixing has a significant impact.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,753
    I mean, it’s a couple of clicks to get rid of tangents.

    Losing performance by a thousand cuts is a thing, and getting yourself in situations where you are using too much ram and too much CPU and nothing really stands out in the profiler is not uncommon.

    So yeah, people shouldn’t lose a ton of time optimizing things before there is a problem, but simple things like this that take a click or two… I don’t see why not.