Search Unity

Detecting fog support on windows store and phone devices

Discussion in 'Windows' started by Peter Rush, Nov 4, 2013.

  1. Peter Rush

    Peter Rush

    Joined:
    Mar 25, 2013
    Posts:
    9
    Hi, as mentioned in the windows store getting started page, sometimes fog is not supported, but it is fairly easy to implement your own.
    https://docs.unity3d.com/Documentation/Manual/windowsstore-gettingstarted.html

    So what is the best way of detecting whether or not fog is supported? for example is there a reliable macro you can simply use in the shader?

    (currently it has not been an optimization issue so I have simply adopted the approach of disabling fog and forcing shaders to run my own implementation, it seems safer to avoid special cases. For the same reason, I simply avoid all fixed function shaders)

    ..also, are the built in shaders that are not well supported across windows store devices and windows phone going to be fixed up shortly or is there some deeper issue preventing this? It seems a niggly little thing that will catch people out again and again.
     
  2. Jonny-Roy

    Jonny-Roy

    Joined:
    May 29, 2013
    Posts:
    666
    Yes just test for the shader version.
     
  3. Peter Rush

    Peter Rush

    Joined:
    Mar 25, 2013
    Posts:
    9
    Hi Jonny, what specific test do you use?
     
  4. Jonny-Roy

    Jonny-Roy

    Joined:
    May 29, 2013
    Posts:
    666
    SystemInfo.graphicsShaderLevel

    Check that it's > 29 I think for fog support.
     
  5. Peter Rush

    Peter Rush

    Joined:
    Mar 25, 2013
    Posts:
    9
    Oh ok, thanks.
    I also found some #defines and pragmas in the documentation that I think you can use directly in the shader code. I had some luck doing that but was not sure I had exactly the right ones (in which case some issue could pop up on some less common device, so I didnt risk it)