您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

36 行
1.3 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
public class DebugViewController : MonoBehaviour
{
public enum SettingType { Material, Rendering }
public SettingType settingType = SettingType.Material;
[Header("Material")]
[SerializeField] int gBuffer = 0;
//DebugItemHandlerIntEnum(MaterialDebugSettings.debugViewMaterialGBufferStrings, MaterialDebugSettings.debugViewMaterialGBufferValues)
[Header("Rendering")]
[SerializeField] int fullScreenDebugMode = 0;
[ContextMenu("Set Debug View")]
public void SetDebugView()
{
HDRenderPipeline hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;
switch ( settingType )
{
case SettingType.Material:
hdPipeline.debugDisplaySettings.SetDebugViewGBuffer(gBuffer);
hdPipeline.debugDisplaySettings.fullScreenDebugMode = FullScreenDebugMode.None;
break;
case SettingType.Rendering:
hdPipeline.debugDisplaySettings.SetDebugViewGBuffer(0);
hdPipeline.debugDisplaySettings.fullScreenDebugMode = (FullScreenDebugMode) fullScreenDebugMode;
break;
}
}
}