GLSL 셰이더 프로그램
셰이더 컴파일 타겟 레벨

Shading language used in Unity

Unity’s shader programs uses a variant of the HLSL language. HLSL is sometimes called Cg but it’s worth bearing in mind that Unity does not use Cg.

Shader compilers

Different platforms use different shader compilers for shader program compilation as follows:

  • Windows and Microsoft platforms (DX11, DX12 and Xbox One) all use Microsoft’s HLSL compiler (currently d3dcompiler_47).
  • OpenGL Core, OpenGL ES 3, OpenGL ES 2.0 및 Metal은 Microsoft의 HLSL을 사용한 후 HLSLcc를 사용하여 GLSL 또는 Metal로 바이트코드 이동을 합니다.
  • 기타 콘솔 플랫폼은 해당되는 컴파일러를 사용합니다(예: PS4에서는 PSSL).
  • Surface Shaders use HLSL and MojoShader for code generation analysis step.

You can use predefined shader macros to identify which compiler Unity is using, for instance to use HLSL syntax only supported by one compiler, or to work around a compiler bug.

관련 항목

GLSL 셰이더 프로그램
셰이더 컴파일 타겟 레벨