Search Unity

[Windows Phone 8.1] QualitySettings - turn off shadows in code

Discussion in 'Windows' started by sstrong, Aug 29, 2014.

  1. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,255
    I have the default 6 Quality Settings. I'm outputting project to Universal App (Windows Store 8.1 and WP 8.1). I'm having issues with shadows on WP 8.1 so I'd like to retain the quality settings but turn off shadows on all the quality settings at runtime. How can I accomplish this?
     
  2. put789456123

    put789456123

    Joined:
    Aug 18, 2014
    Posts:
    4
    I found that a lot of shader are not support in WP8 platform ,when use LIGHTMODE=SHADERCOLLECTOR or FORWARD
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
  4. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,255
    This worked, thanks for the tip

    #if UNITY_WP_8_1
    // Disable shadows on Windows Phone 8.1
    Light[] _lights = GameObject.FindObjectsOfType(typeof(Light)) as Light[];
    if (_lights != null)
    {
    foreach(Light _light in _lights)
    {
    _light.shadows = LightShadows.None;
    }
    }
    #endif