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

Mac OSX, What Pragma's Don't Work?

Discussion in 'Shaders' started by RobertBG, May 27, 2014.

  1. RobertBG

    RobertBG

    Joined:
    Apr 11, 2014
    Posts:
    15
    I have 2 shaders. One a fairly basic Surface shader. And the other, a frag shader in which the surface shader uses 'UsePass' on it. These shaders are working perfectly together on PC, but on Mac OSX it is just black. I really have no idea what the problem is. The surface shader is using "#pragma surface surf BlinnPhong #pragma target 3.0', and the frag shader is using "pragma multi_compile B AA1, #pragma fragmentoption ARB_precision_hint_fastest, #pragma vertex vert, #pragma fragment frag, #pragma target 3.0". Are any of these not compatible with OSX?

    This has been pretty frustrating and I would be very grateful if anyone could answer this question. :)
     
  2. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    I don't think any of those should prevent a shader from working on just Mac OS.

    Are you getting any runtime errors? Perhaps post the entire source?
     
  3. RobertBG

    RobertBG

    Joined:
    Apr 11, 2014
    Posts:
    15
    There are no errors or warnings on my pc. I haven't been able to get a hold of a mac with the Unity project open but have sent demo's to friends with macs and they all get black screens. Does multi-compile work with macs? Multi-compile has always caused me problems but its absolutely required for this shader. :S

    PS, I unfortunately can't share the whole source as this is part of a large project with a company.
     
  4. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Nearly every shader that comes with Unity uses multi-compile. Multi-compile works fine on Mac OS.

    When you run the player on a Mac, it will produce a log that you can read with Console.app. Check the log for any errors.
     
  5. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    You also might want to ask your company to explain why keeping a Blinn Phong surface shader "secret" is more important than getting help making it compatible with a Mac.