Search Unity

Convert a shader to a lower profile

Discussion in 'Shaders' started by mkolb, Apr 22, 2008.

  1. mkolb

    mkolb

    Joined:
    Dec 17, 2007
    Posts:
    48
    Hi,

    I want to convert some of my shaders a lower shader profile/version.
    Are there any applications out there which can assist me in that task or can anyone tell me some directions on what has to be watched out for and so on?

    I would also be happy with some tutorials.
    Maybe there is an Unity way to do this?

    [EDIT]
    Strange thing is, that Unity always compiles for ps2.0 profile, although I removed all instructions in the shader. So it should be ps1.1. Does Unity on DirectX always compile for Pixel Shader 2.0 or is there a way to restrict the shader model for the compiler? Or is OpenGL used for any cards which don't support the shaders?

    Regards
     
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    You're right; currently Unity always compiles pixel shaders to 2.0 profile. The major reason is that there is no equivalent of shader model 1.x functionality in OpenGL (some of that is covered by NVIDIA-specific extensions; some of that is by ATI-specific extensions; making practical use very cumbersome).

    So what you should do if you want to target lower hardware is to convert pixel shaders into fixed function texture combiners (SetTexture commands).