Note: The ShaderLab functionality on this page is legacy, and is documented for backwards compatibility only. If your shader source file includes HLSL code, Unity ignores these commands completely. If your shader source file does not include HLSL code, Unity compiles these commands into regular shader programs on import.
Feature name | 빌트인 렌더 파이프라인 | 유니버설 렌더 파이프라인(URP) | 고해상도 렌더 파이프라인(HDRP) | Custom SRP |
---|---|---|---|---|
Legacy vertex data channel mapping | 지원 | 지원 안 함 | 지원 안 함 | 지원 안 함 |
The BindChannels command allows you to specify how vertex data maps to the graphics hardware. By default, Unity figures out the bindings for you, but in some cases you want custom ones to be used.
예를 들어, 1차 UV 세트가 첫 텍스처 스테이지에 사용되고 2차 UV 세트가 두 번째 텍스처 스테이지에 사용되도록 매핑하거나, 버텍스 컬러를 고려해야 한다고 하드웨어에 알릴 수 있습니다.
BindChannels { Bind "source", target }
버텍스 데이터 source 가 하드웨어 target 에 매핑되도록 지정합니다.
Source는 다음 중 하나일 수 있습니다.
Target은 다음 중 하나일 수 있습니다.
Unity는 타겟에 매핑할 수 있는 소스에 대한 다음과 같은 제한을 적용합니다. Vertex, Normal, Tangent 및 Color 의 소스와 타겟이 일치해야 합니다. 메시의 텍스처 좌표(Texcoord 및 Texcoord1)를 텍스처 좌표 타겟(모든 텍스처 스테이지의 경우__Texcoord, 특정 스테이지의 경우 TexcoordN__)에 매핑할 수 있습니다.
BindChannels는 일반적으로 다음 두 가지 셰이더에 사용됩니다.
// Maps the first UV set to the first texture stage
// and the second UV set to the second texture stage
BindChannels {
Bind "Vertex", vertex
Bind "texcoord", texcoord0
Bind "texcoord1", texcoord1
}
// Maps the first UV set to all texture stages
// and uses vertex colors
BindChannels {
Bind "Vertex", vertex
Bind "texcoord", texcoord
Bind "Color", color
}