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

ForwardAdd pass doesn't work on iOS

Discussion in 'Shaders' started by Big_Friggin_Al, Feb 28, 2016.

  1. Big_Friggin_Al

    Big_Friggin_Al

    Joined:
    Jan 9, 2014
    Posts:
    36
    I took the standard shader, and stripped it down to just two passes (forwardbase and forwardadd) that simply return a color. Base returns 0.5, and add returns a light red.

    In the unity editor this works, and objects appear pink. But on an actual iPhone the objects simply appear dull white, indicating that the forwardadd pass is ignored.

    Am I missing something? Is there a build setting or something that needs to be configured? I can't get my iPhone to include the forwardadd pass!!
     
  2. smd863

    smd863

    Joined:
    Jan 26, 2014
    Posts:
    292
    You won't always have a forward pass; it is just for adding additional pixels lights. Depending on your quality settings you may get 0 or several forward passes, and the default settings for iOS would be low enough to not need any. On mobile you definitely want to avoid reprocessing all your geometry and the entire screen more than once per frame if at all possible. The base pass should be able to handle a single pixel light (as well as baked lighting and maybe some vertex lights/SH) and that is usually all you'd want.
     
    Big_Friggin_Al likes this.
  3. Big_Friggin_Al

    Big_Friggin_Al

    Joined:
    Jan 9, 2014
    Posts:
    36
    You're absolutely correct, I knew some about shaders but didn't know about the quality settings. I also realized that my effect doesn't actually need to interact with any lighting, so I removed the ForwardAdd Lightmode tag and just left my code as a pass without any tags. Now it works like a charm on my iphone, even on the 'fastest' quality setting preset.

    Thank you very much for your help!