What Is Shader Model 5.0

0 views
Skip to first unread message

Christain Cobb

unread,
Aug 3, 2024, 1:02:30 PM8/3/24
to ratechfapi

In the field of 3D computer graphics, the unified shader model (known in Direct3D 10 as "Shader Model 4.0") refers to a form of shader hardware in a graphical processing unit (GPU) where all of the shader stages in the rendering pipeline (geometry, vertex, pixel, etc.) have the same capabilities. They can all read textures and buffers, and they use instruction sets that are almost identical.[1]

Earlier GPUs generally included two types of shader hardware, with the vertex shaders having considerably more instructions than the simpler pixel shaders. This lowered the cost of implementation of the GPU as a whole, and allowed more shaders in total on a single unit. This was at the cost of making the system less flexible, and sometimes leaving one set of shaders idle if the workload used one more than the other. As improvements in fabrication continued, this distinction became less useful. ATI Technologies introduced a unified architecture on the hardware they developed for the Xbox 360. Nvidia quickly followed with their Tesla design. AMD introduced a unified shader in card form two years later in the TeraScale line. The concept has been universal since then.

Early shader abstractions (such as Shader Model 1.x) used very different instruction sets for vertex and pixel shaders, with vertex shaders having much more flexible instruction set. Later shader models (such as Shader Model 2.x and 3.0) reduced the differences, approaching unified shader model. Even in the unified model the instruction set may not be completely the same between different shader types; different shader stages may have a few distinctions. Fragment/pixel shaders can compute implicit texture coordinate gradients, while geometry shaders can emit rendering primitives.[1]

Unified shader architecture (or unified shading architecture) is a hardware design by which all shader processing units of a piece of graphics hardware are capable of handling any type of shading tasks. Most often Unified Shading Architecture hardware is composed of an array of computing units and some form of dynamic scheduling/load balancing system that ensures that all of the computational units are kept working as often as possible.

Unified shader architecture allows more flexible use of the graphics rendering hardware.[2] For example, in a situation with a heavy geometry workload the system could allocate most computing units to run vertex and geometry shaders. In cases with less vertex workload and heavy pixel load, more computing units could be allocated to run pixel shaders.

While unified shader architecture hardware and unified shader model programming interfaces are not a requirement for each other, a unified architecture is most sensible when designing hardware intended to support an API offering a unified shader model.

OpenGL 3.3 (which offers a unified shader model) can still be implemented on hardware that does not have unified shader architecture. Similarly, hardware that supported non unified shader model APIs could be based on a unified shader architecture, as is the case with Xenos graphics chip in Xbox 360, for example.

The unified shader architecture was introduced with the Nvidia GeForce 8 series, ATI Radeon HD 2000 series, S3 Chrome 400, Intel GMA X3000 series, Xbox 360's GPU, Qualcomm Adreno 200 series, Mali Midgard, PowerVR SGX GPUs and is used in all subsequent series.

The High Level Shading Language for DirectX implements a series of shader models. Using HLSL, you can create C-like programmable shaders for the Direct3D pipeline. Each shader model builds on the capabilities of the model before it, implementing more functionality with fewer restrictions.

Shader model 1 started with DirectX 8 and included assembly level and C-like instructions. This model has many limitations caused by early programmable shader hardware. Shader model 2 and 3 greatly expanded on the number of instructions, and constants shaders could use. They are much more powerful than shader model 1, but still carry some of the existing limitations of the first shader model.

Starting with Windows Vista, shader model 4 is a complete redesign. It allows unlimited instructions and constants (within hardware constraints of your machine), has templated objects to make texture sampling cleaner and more efficient, and has the fewest restrictions of any shader model. It does however require the Windows Driver Model which is only available on the Windows Vista (or later) operating system.

Theoretically, you do want to use the lowest level you possibly can. The lower the level, the wider the range of hardware that your game supports, and the more people that can play (and buy) your game.

That said, as you're using DX10/11 already, you're already targeting markets that actually use Vista and up, which mostly coincide with the markets that have DX10-level hardware or better. Targeting SM 5.1 is probably a mistake, but 4.0 is likely just fine.

Given that DX9-level hardware is getting rare for anyone running Vista up these days, I tend to just stick with shader model 4.0 as a minimum. That said, you may feel differently. At least one source indicates that 20% of gamers can't run DX10 either due to hardware or OS, though it doesn't qualify that with market demographics.

There are markets where DX9 is sadly still the API of choice, but those are markets you're very unlikely to have any luck in for a variety of non-technical reasons (e.g. national laws that make life difficult for foreign games, nationalist loyalty from gamers towards domestic game manufacturers, or wildly different game design preferences than present in the West).

This of course is one of the supposed advantages of GL vs DX. With GL, you can use the latest hardware features even on older Windows versions. The flip side is that the drivers are likely out of date and buggy, so your GL app is likely to generate far more support requests and unhappy customers than a DX version. This is why, for example, the browsers all implement WebGL via a DX layer on Windows rather than just using GL directly. Even when the current drivers are high quality, folks on older Windows OSes are far far more likely to be running out of date drivers, and not even know how to upgrade them.

The out-of-date driver problem also affects DX, though to a far lesser degree. I'd suggest targeting only modern Windows OSes unless you have a very strong reason to indicate that XP users make up a significant portion of your target market, as the cost of targeting XP (in terms of development, testing, support, etc.) is just getting higher and higher as time goes on.

The HLSL shader model is a versioning approach indicating which new features are added to the language. Each level allows an application or game to target a well-known set of functionality for development, and allows hardware and driver developers to target that same description for support.

Hey,
I have a shader that is working fine on PC but appears black on mac. If I disable one input and put it back to shader model 3.0 it works. Does mac support shader model 4.0 or is there an other problem? I get no warning or error on the shader.

No, Macs do not support shader models. Shader models are a Microsoft DirectX thing, and Macs use OpenGL. It may be a specific feature that you are using that is causing it to mess up. I know that I was having trouble getting derivatives (dds ddy) to work with OGL.

You can use #pragma directives to indicate that a shaderA program that runs on the GPU. More info
See in Glossary requires certain GPU features. At runtime, Unity uses this information to determine whether a shader program is compatible with the current hardware.

You can specify individual GPU features with the #pragma require directive, or specify a shader model with the #pragma target directive. 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.

It is important to correctly describe the GPU features that your shader requires. 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.

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. To avoid seeing this warning message, explicitly add the requirements or use an appropriate target value in your code.

You can also use the #pragma require directive followed by a colon and a list of space-delimited shader keywords. This means that the requirement applies only to variants that are used when any of the given keywords are enabled.

You can also use the #pragma target directive followed by a list of space-delimited shader keywords. This means that the requirement applies only to variants that are used when any of the given keywords are enabled.

I don t know what version is on my notebook because of this I detailed all the components on it ,probably is intel hd graphics 2000 or 3000, please tell me if it supports pixel shader 3 this model or if they are new drivers to improve the performance for this model.I want to know what games can I play with this laptop and if it is a list made for my model processor.I want to know if I can play Counter Strike Global Offensive, Call of Duty: Modern Warfare 2 and 3, Battlefield: Bad Company, Street Fighter IV and others.

I have downloaded the latest drivers for intel hd graphics i3 version 8.15.10.2993 but shaders 3.0 aren't still supported. I checked it by GPU caps viewer and it shows that supported just 2.0 not over

glclal, I am sorry about the trouble, I have confirmed through engineering that once you install the latest video drivers, shader model is available with version 4, please take a look at some specifications here:

c80f0f1006
Reply all
Reply to author
Forward
0 new messages