참고: 이 페이지의 ShaderLab 기능은 레거시이며, 이전 버전과의 호환성 목적으로만 문서화되었습니다. 셰이더 소스 파일에 HLSL 코드가 포함된 경우, Unity는 이러한 커맨드를 완전히 무시합니다. 셰이더 소스 파일에 HLSL 코드가 포함되지 않은 경우, Unity는 임포트 시 이러한 커맨드를 일반 셰이더 프로그램으로 컴파일합니다.
기능 이름 | 빌트인 렌더 파이프라인 | 유니버설 렌더 파이프라인(URP) | 고해상도 렌더 파이프라인(HDRP) | 커스텀 SRP |
---|---|---|---|---|
레거시 버텍스 데이터 채널 매핑 | 지원 | 지원 안 함 | 지원 안 함 | 지원 안 함 |
BindChannels 커맨드로 버텍스 데이터 맵을 그래픽스 하드웨어에 매핑하는 방법을 지정할 수 있습니다. Unity는 기본적으로 바인딩을 자동으로 계산하지만, 경우에 따라 커스텀 바인딩을 사용하고 싶을 수 있습니다.
예를 들어, 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
}
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.