UsePass 명령은 다른 셰이더에서 명명된 패스를 사용합니다.
UsePass "Shader/Name"
주어진 셰이더에서 주어진 이름을 가지는 모든 패스를 삽입합니다. 셰이더/이름 에는 셰이더 이름 및 패스의 이름을 슬래시로 구분하여 넣습니다. 지원되는 서브셰이더 중 첫 번째 서브셰이더만 고려된다는 점에 유의해야 합니다.
몇몇 셰이더는 다른 셰이더로부터 기존 패스를 재사용하여 코드 중복을 줄일 수 있습니다. 예를 들어 오브젝트 아웃라인을 그리는 셰이더 패스가 있을 경우 이 패스를 다른 셰이더에서 재사용하길 원할 수 있습니다. UsePass 명령이 바로 이 일을 하는 명령으로서 다른 셰이더로부터 주어진 패스를 포함합니다. 예를 들어 다음 명령은 내장 VertexLit 셰이더로부터 “SHADOWCASTER”라는 이름의 패스를 사용합니다.
UsePass "VertexLit/SHADOWCASTER"
UsePass가 작동하려면 사용하려는 패스에 이름을 부여해야 합니다. 패스 내의 Name 명령을 통해 이름을 붙입니다.
Name "MyPassName"
내부적으로 모든 패스명은 대문자이므로, UsePass는 반드시 이름을 대문자로 나타내야 합니다.
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.