Search Unity

4.5 transparent shader going full black on device

Discussion in 'Android' started by Metron, May 28, 2014.

  1. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Hi,

    I've converted a 4.3 project to 4.5. I use the "Car Paint Shader Pro Mobile" shader set and particularly the "RedDotGames/Mobile/Car Glass" shader.

    In 4.3 the shader works flawless when the application is exported and run on Android devices. Once I convert the project to 4.5, the shader turns full black (no more transparency) on the device (it's still rendered transparent in the editor).

    Is there some changement to the transparency handling? The layer is NOT set to TransparentFX (as I need my own layer for this).

    Thanks for your help.
     
  2. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Bump...
     
  3. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    Does adb logcat complain something when the shader is loaded on the device?
     
  4. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    I have more or less the same problem but for an iOS game.

    I'm getting following errors in xCode:

    WARNING: no native support for texture format 5, converting to 4!

    WARNING: Shader Unsupported: 'RedDotGames/Mobile/Car Paint DuoColor' - Pass '' shader state not supported
     
  5. sakus

    sakus

    Joined:
    Oct 9, 2013
    Posts:
    47
    ..bump.. any progress with this?

    I'm running into the same problem using a very basic shader with transparency (I use it to mask a second camera inside a circle shaped texture and use it as a mini map). It worked perfectly on 4.3, but after updating to 4.5 it doesn't work anymore when built for Android yet it still works in the editor. I can't see any shader related warnings or errors in adb logs.

    I see similar reports here and there (for both Android and IOS) but so far haven't seen a solution.. anyone?
     
  6. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Sorry, I didn't have much time recently... I only could check it back today... so basically, even with the latest Unity version, I get this error:

    06-27 12:32:36.310: D/Unity(9398): Unsupported: 'RedDotGames/Mobile/Car Glass Advanced' - Pass 'FORWARD' shader state not supported

    So, same as for Fred in his iOS game... but here for Android...

    Does anyone know (UNITY DEV) how to solve this "quickly"?
     
  7. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Bug submitted... case 616289
     
  8. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Bump.... this really starts to suck... I really would like some UNITY DEVS to react on this!!!!
     
  9. Romeo-Ordos

    Romeo-Ordos

    Joined:
    Jan 21, 2013
    Posts:
    10
    Can you share the code of the shader? I'll try to debug it in perfhud es and adreno profiler.
     
  10. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Unfortunately I cannot share the code. It's the "RedDotGames/Mobile/Car Glass" shader from the "Car Paint Shader Pro Mobile" shader set (Asset store purchase).
     
  11. Romeo-Ordos

    Romeo-Ordos

    Joined:
    Jan 21, 2013
    Posts:
    10
    I think no one can help you without ability to reproduce this issue.

    If you are not allowed to share the code then contact author of this shader to resolve this problem.

    All my custom shaders work as expected in 4.5 so it can be specific syntax compability error.
     
    Last edited: Jul 1, 2014
  12. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Since I submitted a bug report and since Unity has full access to the asset store (and I've given them access to my complete project including shaders), this should be no problem for them to reproduce and check... in fact, it's a android regression error. Everything works as expected in 4.3...
     
  13. sakus

    sakus

    Joined:
    Oct 9, 2013
    Posts:
    47
    In my case it's a very basic shader like this. I got it from somewhere on the forums/wiki/something and I know absolutely nothing about shader programming myself..

    Code (csharp):
    1.  
    2. Shader"Customs/MiniMapRound" {
    3.  
    4.     Properties {
    5.         _Mask ("CullingMask", 2D) = "white" {}
    6.         _Cutoff ("Alphacutoff", Range (0,1)) = 0.5
    7.      }
    8.  
    9.     SubShader {
    10.         Tags {"Queue" = "Background"}
    11.         BlendSrcAlphaOneMinusSrcAlpha
    12.         LightingOff
    13.         ZWriteOn
    14.         ZTestAlways
    15.         AlphatestLEqual [_Cutoff]
    16.    
    17.         Pass {
    18.             SetTexture [_Mask] {combinetexture}
    19.         }
    20.     }
    21. }
    22.  
     
  14. GearedSun

    GearedSun

    Joined:
    Apr 17, 2014
    Posts:
    30
  15. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    hmmm... looks similar, yes... definitely worth having an eye on...

    What disturbs me is that this is an obvious regression... it shouldn't have passed in any case...
     
  16. emmalloyd

    emmalloyd

    Joined:
    Dec 5, 2013
    Posts:
    20
    Hey, I'm having a similar issue except it is in unity, my shader breaks randomly. The game I'm working on isn't even on a device yet, it just breaks in unity. The transparency will work fine, then will either randomly stop working, or will break when I close and reopen unity. I have to create a new shader and copy and paste the code over, but if I try to name it back to what I want it to be called it breaks again, or it will break again after a while anyway. Any help with this would be greatly appreciated!
     
  17. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
  18. sakus

    sakus

    Joined:
    Oct 9, 2013
    Posts:
    47
    My problem is fixed in the latest 4.5.3p2 version