Search Unity

Renderer platform for shaders for W8/WP8

Discussion in 'Windows' started by Kaldorei, Jul 24, 2013.

  1. Kaldorei

    Kaldorei

    Joined:
    Aug 12, 2010
    Posts:
    112
    Hello,

    We use conditionnal compilation for shaders targeted for different platforms, we highly optimize shaders depending on the platform and we can't use the same shader that we use for d3d9/d3d11 since it's the huge pc version, we'd like to know the rendering platform for shader instruction exclude_renderers / only_renderers for W8 / WP8 other than d3d9/d3d11, if not is there a way to have something like d3d_w8 / d3d_wp8 in future version ?

    Thanks.
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    For Windows Store Apps and Windows Phone 8 two types of shaders are used:
    * d3d11
    * d3d11_9x

    (You can see that by opening precompiled shader version)

    Depending on available DirectX 11 feature level - d3d11 or d3d11_9x is used.
    As far as I recall, if available feature level is >= 10.0 d3d11 shaders are used, if not - d3d11_9x used.

    Here are some statistics:
    * Most PCs, Surface Pro, use DX11 feature level 11.0 (d3d11 shaders will be used)
    * ARM tablets (like Surface RT, and other) use feature level 9.1 or 9.3 (d3d11_9x shaders are used)
    * Windows Phone 8 use feature level 9.3 (d3d11_9x shaders are used)

    You can say what feature level is used by looking at the log shown in Visual Studio's Output window, or UnityPlayer.log

    As for your problem, maybe you can shader level of detail feature - http://docs.unity3d.com/Documentation/Components/SL-ShaderLOD.html ?

    Cheers
     
    Last edited: Jul 25, 2013
  3. Kaldorei

    Kaldorei

    Joined:
    Aug 12, 2010
    Posts:
    112
    My bad i forgot the lod feature but i want to create the shader as generic as possible (for selling as the asset store, i think i will use d3d11_9x thank you very much !)