Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

CG shaders stopped working in 4.x for Android

Discussion in 'Android' started by soulburner, Sep 17, 2013.

  1. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    169
  2. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    bug case number?
     
  3. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    169
    Support Case # 00134530: Re: Unity 3.5 -> 4.2.x upgrade problem
     
  4. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    169
    PS: The same project built for Amazon Kindle (the same Android) works fine. It seems to be that shader bug appears only on specific GPU models. And definetely the same project works fine when build in Unity 3.5 for any hardware.
     
  5. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    omhm - thats something for support (read: not interested) bug case number or you didnt submit one?
     
  6. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    169
    I've sent the description to support[at]unity3d.com and received the message with this case number.

    I don't know how to submit it in other way.
     
  7. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    169
    I've got a reply from unity support today. It is.... hmmm.... strange.

    They are advicing me to use 3.5 and giving me a solution : "revert project back to 3.5".
     
  8. Xaron

    Xaron

    Joined:
    Nov 15, 2012
    Posts:
    379
    Is that GPU a Mali-400 MP by any chance? (like in the Samsung S3 and Galaxy Note 2?)

    If so, ... oh well...
     
  9. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    sheesh, you have unity dev right there, dont listen to support.
    http://unity3d.com/BugReportingFAQ
    um... what so special about mali?
     
  10. Xaron

    Xaron

    Joined:
    Nov 15, 2012
    Posts:
    379
  11. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    how is this even related to cg shaders? leave alone the fact of being related to unity? 8)
    guys, please, if you want devs to help you - give us bug reports with repro project - we can argue to death about whatever without it
     
  12. Xaron

    Xaron

    Joined:
    Nov 15, 2012
    Posts:
    379
    My apologies, should have read that topic more carefully...
     
  13. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    thats fine, but where is your bug report ;-). no, really - looking at related thread - it has quite too much problems mentioned
     
  14. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    169
    I've solved it! The reason was of variables beginning with underscore!

    changing this:

    PHP:
    v2f vert appdata_t _in ) {
    to this:

    PHP:
    v2f vert appdata_t a_in ) {
    made all my CG shaders work again!

    Note, that all was ok in Unity 3.5.
     
  15. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    i can bet that in your logcat there is an error compiling shader about having '__' in the name
    in 3.5->4.x move we changed lots about glsl shader conversion (esp, adding <some stuff>_ prefix) - in your case it resulted in __ which some compilers do not like
     
  16. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    169
    Maybe. But it was confusing that no error was displayed in Unity during compilation and that the problem occurs only on specific Android hardware. I just didn't look at device's log...

    Anyway, I hope this topic will help somebody to solve a similar problem.
     
  17. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    read carefully again ;-)
    i agree that it might be good for us to try and prevent that - but android zoo is way too... "пёстрый" ;-)