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

Shader Model Emulation (Just released a demo and can't find a way)

Discussion in 'Shaders' started by Blorfy, Sep 17, 2021.

  1. Blorfy

    Blorfy

    Joined:
    Aug 28, 2012
    Posts:
    25
    Hi All,

    I just released a demo of my game today, and it turns out that I need to make some downgraded shaders for lower end machines. However, I do not have one of these lower end machines to test on. I see that there is supposed to be Shader Model emulation here:

    https://docs.unity3d.com/2018.4/Documentation/Manual/GraphicsEmulation.html

    But it has been replaced with Hardware Tiers which I cannot seem to be able to define. I really need to be able to test Shader Model 3.0 like right now.

    Does anyone know of a method to do this?

    Thanks!!!
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Unity officially no longer supports hardware that's only Shader Model 3.0, which is why that's all gone away. If you're on Unity 2018 or newer it shouldn't even be able to run on desktop hardware that's below Shader Model 5.0. If you need Shader Model 3.0 desktop support, your project needed to be created using Unity 2017.2 or older.
     
  3. Blorfy

    Blorfy

    Joined:
    Aug 28, 2012
    Posts:
    25
    Oh my machine supports 5.0, BUT I need to test my shaders for low end machines for example using HD Graphis 520 and 600 cards.

    My grass uses a geometry shader requiring 4.0 but these machines only run 3.0. So today I got pictures of people playing my game with no grass (grass is a resource they need to harvest) so I tracked it back to this. Now I am trying to shove a fix in there, but the workflow is horrible.

    This means I need to write a set of 3.0 SubShaders, but I do not have a convenient way to test those shaders aside from literally commenting out all my geometry shaders each time I want to test something.
     
  4. Blorfy

    Blorfy

    Joined:
    Aug 28, 2012
    Posts:
    25
    It could be 3.5 I need as well. I just know these HD Graphics cards are barfing on the geometry shaders right now, so I need to bypass them
     
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Right. But Unity itself no longer supports hardware that old, so they removed the option to emulate that level of hardware. If you built your game using Unity 2017.3 or newer, it should not even run on GPUs that don't support DirectX 11.

    And the Intel HD Graphics 520 & 600 support Direct3D 12. This isn't a Shader Model issue. This is a "Intel's drivers are carp" problem. Emulating Shader Model 3 or 3.5 wouldn't necessarily solve the problem, as the game isn't running using Shader Model 3.0 or 3.5 on those GPUs, it's running using Shader Model 5.0 still.

    The problem is either a driver bug or the drivers being much more strict about the shader spec for geometry shaders. In other words the only way to debug / fix the issue is by testing on that hardware.
     
  6. Blorfy

    Blorfy

    Joined:
    Aug 28, 2012
    Posts:
    25
    Oh I see. Hmm. So right now I have a SubShader with the geometry shader in there, and then a second subshader that just has a vert and frag. I cannot test this, but do you think that the HD Graphics cards will at least fall through to the basic shader? Otherwise I may be building these basic shader fallbacks for nothing.
     
  7. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Honestly not sure. Depends on how it's failing. If the sub shader with the geometry shader fails to compile, then yes it'll drop to the next sub shader or to the fallback. If it compiles, but then errors while rendering no.
     
  8. Blorfy

    Blorfy

    Joined:
    Aug 28, 2012
    Posts:
    25
    Ok thanks for the info. I will have to ping the people with the problem and make a beta branch for them.