스크립터블 렌더 파이프라인(SRP)에서 프로젝트에는 액티브 렌더 파이프라인 에셋이 있어야 합니다. 이 페이지에는 Unity 에디터와 런타임 시 프로젝트에 대한 렌더 파이프라인 에셋을 설정하는 데 대한 정보가 포함되어 있습니다.
SRP는 설정 가능성이 매우 높기 때문에 액티브 렌더 파이프라인 에셋을 변경하면 품질 티어가 다른 동일한 렌더 파이프라인 인스턴스를 사용하는 것과 같은 아주 사소한 변경 사항이 발생하거나 유니버설 렌더 파이프라인(URP)에서 고해상도 렌더 파이프라인(HDRP)으로 전환하는 것과 같은 매우 큰 변경 사항이 발생할 수 있습니다.
액티브 렌더 파이프라인 에셋을 다른 렌더 파이프라인 인스턴스를 사용하는 에셋으로 변경하는 경우 프로젝트의 에셋과 코드가 새로운 렌더 파이프라인 인스턴스와 호환 가능한지 확인해야 합니다. 그렇지 않은 경우 오류나 의도치 않은 비주얼 이펙트가 발생할 수 있습니다.
또한 새로운 렌더 파이프라인 에셋으로 바꾸면 Unity가 현재의 렌더 파이프라인 인스턴스를 파괴하고 새로운 렌더 파이프라인 에셋의 CreatePipeline()
메서드를 호출합니다. SRP의 코드에 따라 연산적으로 리소스를 많이 소모하는 작업일 수 있습니다.
프로젝트를 편집하는 동안 SRP로 작업할 수 있도록 Unity 에디터에 렌더 파이프라인 에셋을 설정해야 합니다. 에디터에 설정된 렌더 파이프라인 에셋은 Unity가 빌드된 플레이어에서 기본적으로 사용하는 에셋입니다.
Graphics Settings 창에서 프로젝트에 대한 렌더 파이프라인 에셋을 설정합니다.
렌더 파이프라인 에셋 간에 전환하려면 런타임 시 렌더 파이프라인 에셋을 설정합니다. 이 작업은 빌드된 플레이어나 에디터의 플레이 모드에서 수행할 수 있습니다.
런타임 시 GraphicsSettings.renderPipelineAsset API를 사용하여 렌더 파이프라인 에셋을 설정합니다.
다음 예시 코드는 두 가지 렌더 파이프라인 에셋 간에 전환하는 방법을 보여줍니다.
using UnityEngine;
using UnityEngine.Rendering;
public class SwitchRenderPipelineAsset : MonoBehaviour
{
public RenderPipelineAsset exampleAssetA;
public RenderPipelineAsset exampleAssetB;
void Update()
{
if (Input.GetKeyDown(KeyCode.A)) {
GraphicsSettings.renderPipelineAsset = exampleAssetA;
Debug.Log("Active render pipeline asset is: " + GraphicsSettings.renderPipelineAsset.name);
}
else if (Input.GetKeyDown(KeyCode.B)) {
GraphicsSettings.renderPipelineAsset = exampleAssetB;
Debug.Log("Active render pipeline asset is: " + GraphicsSettings.renderPipelineAsset.name);
}
}
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.