Search Unity

TEXCOORDn and COLORn difference

Discussion in 'Shaders' started by exltus, Aug 24, 2020.

  1. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    Is there andy performance difference between using TEXCOORD0 or COLOR0 as input of fragment shader on mobile defices? I readed that COLOR is lower precission here https://docs.unity3d.com/Manual/SL-ShaderSemantics.html . But is is still valid informationow nowadays? It is just better use TEXCOORD everywhere?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    COLOR
    is lower precision for vertex shader inputs on all platforms because of how Unity sends vertex data to the GPU. There is no difference between
    COLOR#
    and
    TEXCOORD#
    when passing data between the vertex shader and fragment shader. With the exception of
    SV_Position
    *, basically all vertex shader output / fragment shader inputs semantics are treated the same. They're just generic ordered float values for modern APIs.

    * and a few other very uncommon semantics.
     
    vladke95 likes this.