알파 투 커버리지 모드는 MSAA(멀티 샘플 안티앨리어싱)를 초목 셰이더와 같이 알파 테스트를 사용하는 셰이더와 함께 사용할 때 발생하는 과도한 앨리어싱을 줄일 수 있습니다. 이를 위해 프래그먼트 셰이더 결과의 출력에서 알파 값에 비례하여 멀티 샘플 커버리지 마스크를 수정합니다.
이 커맨드는 MSAA와 함께 사용할 수 있습니다. MSAA를 사용하지 않을 때 알파 투 커버리지 모드를 활성화하는 경우, 여러 그래픽스 API와 GPU가 이를 각기 다르게 취급하므로 예측하기 어려운 결과가 발생할 수 있습니다.
Shader "Examples/CommandExample"
{
SubShader
{
// The rest of the code that defines the SubShader goes here.
Pass
{
// Enable alpha-to-coverage mode for this Pass
AlphaToMask On
// The rest of the code that defines the Pass goes here.
}
}
}
이 예제 코드는 SubShader 블록에서 이 커맨드를 사용하기 위한 구문을 나타냅니다.
Shader "Examples/CommandExample"
{
SubShader
{
// Enable alpha-to-coverage mode for this SubShader
AlphaToMask On
// The rest of the code that defines the SubShader goes here.
Pass
{
// The rest of the code that defines the Pass goes here.
}
}
}