This is the highest OpenGL level supported on a Mac.
Interpolators15 mrt4 integers 2darray instancingĮquivalent to DirectX shader model 4.0, but without the requirement to support 8 MRTs.
Might work on some OpenGL ES 2.0 devices, depending on driver extensions and features. Works on all platforms supported by Unity.Īlmost the same as 3.0, but with only 8 interpolators, and no explicit LOD texture sampling. Limited amount of arithmetic and texture instructions 8 interpolators no vertex texture sampling no derivatives in fragment shaders no explicit LOD texture sampling. Read the descriptions carefully to ensure that you understand the differences. Note: Unity’s shader models are similar to DirectX shader models and OpenGL version requirements, but they do not correspond exactly. Here is the list of shader models that Unity uses, and the combination of #pragma require values that each corresponds to. When you specify keywords for #pragma target, you do not use a colon. When you specify keywords for #pragma require, you use a colon. Note: The syntax for specifying keywords for #pragma require and #pragma target is slightly different.
This means that the requirement applies only to variants that are used when any of the given keywords are enabled.įor example: #pragma target 4.0 EXAMPLE_KEYWORD OTHER_EXAMPLE_KEYWORD You can also use the #pragma target directive followed by a list of space-delimited shader keywords. To specify a shader model, use #pragma target directive. #pragma require integers mrt8 : EXAMPLE_KEYWORD In this example, the shader requires integers in all cases, and mrt8 if EXAMPLE_KEYWORD is enabled. You can use multiple #pragma require lines. This means that the requirement applies only to variants that are used when any of the given keywords are enabled.įor example: #pragma require integers mrt8 : EXAMPLE_KEYWORD OTHER_EXAMPLE_KEYWORD You can also use the #pragma require directive followed by a colon and a list of space-delimited shader keywords. For example: #pragma require integers mrt8 To specify required features, use the #pragma require directive, followed by a list of space-delimited values. Specifying GPU features or a shader model To avoid seeing this warning message, explicitly add the requirements or use an appropriate target value in your code. If the list of requirements (or the equivalent target value) does not already include these values, Unity displays a warning message when it compiles the shader, to indicate that it has added these requirements. If a shader defines a tessellation stage (with #pragma hull or #pragma domain), Unity automatically adds tessellation to the list of requirements.If a shader defines a geometry stage (with #pragma geometry), Unity automatically adds geometry to the list of requirements.
If your shader defines certain shader stages, Unity automatically adds items to the list of requirements. Default behaviorīy default, Unity compiles shaders with #pragma require derivatives, which corresponds to #pragma target 2.5. If your shader uses features that are not included in the list of requirements, this can result in either compile time errors, or in devices failing to support shaders at runtime. It is important to correctly describe the GPU features that your shader requires. A shader model is a shorthand for a group of GPU features internally, it is the same as a #pragma require directive with the same list of features. You can specify individual GPU features with the #pragma require directive, or specify a shader model with the #pragma target directive. At runtime, Unity uses this information to determine whether a shader program is compatible with the current hardware. More info See in Glossary requires certain GPU features. You can use #pragma directives to indicate that a shader A program that runs on the GPU.