When writing either Surface Shaders or regular Shader Programs, the Cg/HLSL source can be compiled into different “shader models”. Higher shader compilation targets allow using more modern GPU functionality, but might make the shader not work on older GPUs or platforms.
컴파일 타겟은 #pragma target
name 지시자로 표시하며, 예제는 다음과 같습니다.
#pragma target 3.0
By default, Unity compiles shaders into lowest supported target; roughly shader model 2.0 equivalent. Some other compilation directives make the shader automatically be compiled into a higher target:
#pragma geometry
) 컴파일 타겟을 4.0
으로 설정합니다.#pragma hull
or #pragma domain
) sets compilation target to gl4.1
.아래 리스트는 지원되는 셰이더 모델을 성능의 오름차순으로 나열합니다(일부 경우 더 높은 플랫폼/GPU 요구 사항 순서).
es3.0
타겟의 모든 것이 포함됩니다.Note that all OpenGL-like platforms (including mobile) are treated as “capable of shader model 3.0”. WP8/WinRT platforms (DX11 feature level 9.x) are treated as only capable of shader model 2.0.