Search Unity

_sat not permitted on tex instructions

Discussion in 'Shaders' started by aubergine, Jan 8, 2013.

  1. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    This only happens in surface shaders, whenever i use saturate on a texture sample and use the return value in any way with o.Specular
    it gives me this error: D3D shader assembly failed with: (26): error X5911: _sat not permitted on tex* instructions.

    float texture = tex2D(_MyTex, myUv).r;
    float value = saturate(texture); <--- this compiles until here if the value is not used below.
    o.Specular = specularity * value; <-- this gives the error if i use the above value

    Googling this gives only one smiliar result on Strumpy shader editor.

    EDIT: Oddly enough, pragma target 3.0 solves the issue but why wouldnt it work in 2.0???
     
    Last edited: Jan 8, 2013