Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
motorsep's avatar
motorsep
Start Partner
10 years ago

Unity 5: standard vs mobile material/shader for Gear VR ?

Which shader/material should be used for Gear VR, standard (with or without specular) or mobile (diffuse or bumped specular) ?

10 Replies

Replies have been turned off for this discussion
  • Note that Unity's built-in VertexLit shaders are broken in Android Lollipop with recent Unity versions (on the Note 4 at least).
  • "cybereality" wrote:
    I'm not sure. Maybe try both and look at your performance.


    How would I check performance while wearing Gear VR ?
  • @cybereality: So, how do I gauge performance while wearing Gear VR ?
  • owenwp's avatar
    owenwp
    Expert Protege
    Standard has significant slowdowns on mobile. You will probably have a very hard time hitting 60fps unless you use the mobile shaders, that's why they are there.

    As a rule you want to avoid doing any lighting at all if possible, using only lightmaps, or even just plain unlit texture mapping if your art style allows for it. If you want more than that you will probably need to write your own tightly optimized shaders, the built in realtime unity lighting is expensive unless you keep it very simple.
  • Thanks owenwp!

    How would I use emission texture with mobile shaders? Would I have to modify mobile shaders?

    Btw, is it still "expensive" to use single direct light to have dynamic shadows cast by dynamic objects ? (characters)
  • owenwp's avatar
    owenwp
    Expert Protege
    You might need a custom shader, I dont think any of the built in mobile ones do multi-texturing. It would also be a lot more efficient if you didn't use a separate emissive texture, but instead used the alpha channel of the diffuse texture to make parts of it emissive.

    o.emissive = diffuse.rgb * diffuse.a

    A single directional light is fairly inexpensive, since it is optimized to be done in the main rendering pass. Giving that light shadows is fairly costly though, but maybe doable if you keep the number of shadow casting and receiving objects small. Every caster and receiver is an extra draw call. Try to keep shadow distance small and use only one cascade.
  • Sorry, I am just starting with Unity. How do I use that code to make those alpha-masked parts glow on my wall model for example (and perhaps flicker/pulsate) ?

    Is it costly to use realtime lights that don't cast any shadows? For example, Doom 3 has so called blend lights that are quite "cheap", since they don't do any per pixel lighting. Is there anything like that in Unity 5 for mobile platforms ?

    Thanks.