Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Doesn't Material(Shader).EnableKeywords(DisableKeywords) work on mobile?

Discussion in 'Shaders' started by Aldrick, Nov 24, 2016.

  1. Aldrick

    Aldrick

    Joined:
    Feb 19, 2014
    Posts:
    64
    I am using shader_feature keywords to control the outline pass of a character shader.It works perfect on PC.But when building it to Android APK,this feature doesn't work at runtime,as I switch this keyword,the material or shader doesn't change.

    Anyone know why?
     
  2. tsangwailam

    tsangwailam

    Joined:
    Jul 30, 2013
    Posts:
    280
    Did you include all the shader various in the build?
     
  3. LeifStro

    LeifStro

    Joined:
    Mar 23, 2015
    Posts:
    27
    I know this is an old question, but make sure your shader specifies #pragma multi_compile and not #pragma shader_feature.

    When you don't have multi_compile specified, your build will only compile and include the shader variants on in-use materials, and the default shader setting.
     
    tsuhan likes this.