浏览代码

Add GBuffer debug for debug view controller.

Filter out Play Modes tests in editor test list.
Remove unecessary vars from scene setup
Update MotionVector test template because of optimisation (and frame offset)
/main
Remy 7 年前
当前提交
4a36daf4
共有 8 个文件被更改,包括 178 次插入98 次删除
  1. 156
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector.unity.png
  2. 4
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector.unity
  3. 11
      Tests/Scripts/Editor/GraphicTests/Framework/TestFramework.cs
  4. 6
      Tests/Scripts/GraphicTests/Framework/SetupSceneForRenderPipelineTest.cs
  5. 11
      Tests/Scripts/GraphicTests/Framework/TestFrameworkTools.cs
  6. 24
      Tests/Scripts/GraphicTests/HDRenderPipeline/DebugViewController.cs
  7. 53
      Tests/Scripts/Editor/GraphicTests/HDRenderPipeline/DebugViewController_Editor.cs
  8. 11
      Tests/Scripts/Editor/GraphicTests/HDRenderPipeline/DebugViewController_Editor.cs.meta

156
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector.unity.png
文件差异内容过多而无法显示
查看文件

4
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector.unity


- component: {fileID: 1962206527}
- component: {fileID: 1962206526}
m_Layer: 0
m_Name: Settings
m_Name: DebugSettings
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_Script: {fileID: 11500000, guid: a9ad82d3a5300af40a7a6a9927907436, type: 3}
m_Name:
m_EditorClassIdentifier:
settingType: 1
gBuffer: 0
fullScreenDebugMode: 9
--- !u!4 &1962206527
Transform:

11
Tests/Scripts/Editor/GraphicTests/Framework/TestFramework.cs


yield return null;
}
// Handle play mode and things to do before
if (testSetup.testInPlayMode)
{
//if (!testSetup.invokeAtStart) testSetup.thingToDoBeforeTest.Invoke();
//EditorApplication.isPlaying = true;
}
else
{
testSetup.thingToDoBeforeTest.Invoke();
}
testSetup.thingToDoBeforeTest.Invoke();
// Render the camera
Texture2D captured = TestFrameworkTools.RenderSetupToTexture(testSetup);

6
Tests/Scripts/GraphicTests/Framework/SetupSceneForRenderPipelineTest.cs


public UnityEvent thingToDoBeforeTest;
[Header("Run Play Mode for test")]
public bool testInPlayMode = false;
public bool invokeAtStart = true;
public int forcedFrameRate = 60;
public int waitForFrames = 30;
int waitedFrames = 0;

{
// Wait for other things to happend, in particular allow for the render pipeline to reset
yield return new WaitForEndOfFrame();
if (invokeAtStart) thingToDoBeforeTest.Invoke();
if (!testInPlayMode) _readyForCapture = true;
Time.captureFramerate = forcedFrameRate;
}

11
Tests/Scripts/GraphicTests/Framework/TestFrameworkTools.cs


List<string> allPaths_List = new List<string>(allPaths);
allPaths_List.Sort();
// Get the play mode scenes
List<string> playModeScenes = new List<string>();
foreach( TestInfo ti in CollectScenesPlayMode.GetScenesForPipeline( _pipelinePath ) )
{
playModeScenes.Add(ti.templatePath);
}
// construct all the needed test infos
for (int i = 0; i < allPaths_List.Count; ++i)
{

var split = s_Path.Aggregate("", Path.Combine);
split = string.Format("{0}{1}", split, Path.DirectorySeparatorChar);
var splitPaths = p.FullName.Split(new[] { split }, StringSplitOptions.RemoveEmptyEntries);
// Filter out play mode tests from the list
if (playModeScenes.Contains(splitPaths.Last()))
continue;
TestInfo testInfo = new TestInfo()
{

24
Tests/Scripts/GraphicTests/HDRenderPipeline/DebugViewController.cs


public class DebugViewController : MonoBehaviour
{
[SerializeField] FullScreenDebugMode fullScreenDebugMode = FullScreenDebugMode.None;
public enum SettingType { Material, Rendering }
public SettingType settingType = SettingType.Material;
MaterialDebugSettings materialDebugSettings = new MaterialDebugSettings();
[Header("Material")]
[SerializeField] int gBuffer = 0;
//DebugItemHandlerIntEnum(MaterialDebugSettings.debugViewMaterialGBufferStrings, MaterialDebugSettings.debugViewMaterialGBufferValues)
[Header("Rendering")]
[SerializeField] int fullScreenDebugMode = 0;
hdPipeline.debugDisplaySettings.fullScreenDebugMode = fullScreenDebugMode;
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;
}
}
}

53
Tests/Scripts/Editor/GraphicTests/HDRenderPipeline/DebugViewController_Editor.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
using UnityEditor.Experimental.Rendering;
using UnityEditor.Experimental.Rendering.HDPipeline;
[DisallowMultipleComponent]
[CustomEditor(typeof(DebugViewController))]
public class DebugViewController_Editor : Editor
{
SerializedProperty s_settingType;
SerializedProperty s_gBuffer;
SerializedProperty s_fullScreenDebugMode;
public void OnEnable()
{
s_settingType = serializedObject.FindProperty("settingType");
s_gBuffer = serializedObject.FindProperty("gBuffer");
s_fullScreenDebugMode = serializedObject.FindProperty("fullScreenDebugMode");
}
public override void OnInspectorGUI()
{
//base.OnInspectorGUI();
//EditorGUILayout.PropertyField(s_settingType);
int i_settingType = s_settingType.intValue;//= (int) (target as DebugViewController).settingType;
s_settingType.intValue = GUILayout.Toolbar(s_settingType.intValue, new string[] { "Material", "Rendering" });
switch ( (DebugViewController.SettingType) s_settingType.intValue )
{
case DebugViewController.SettingType.Material :
s_gBuffer.intValue = EditorGUILayout.IntPopup(new GUIContent("GBuffer"), s_gBuffer.intValue, MaterialDebugSettings.debugViewMaterialGBufferStrings, MaterialDebugSettings.debugViewMaterialGBufferValues);
break;
case DebugViewController.SettingType.Rendering:
s_fullScreenDebugMode.intValue = EditorGUILayout.IntPopup(new GUIContent("GBuffer"), s_fullScreenDebugMode.intValue, DebugDisplaySettings.renderingFullScreenDebugStrings, DebugDisplaySettings.renderingFullScreenDebugValues);
break;
}
if ( serializedObject.ApplyModifiedProperties() )
{
serializedObject.Update();
(target as DebugViewController).SetDebugView();
}
}
}

11
Tests/Scripts/Editor/GraphicTests/HDRenderPipeline/DebugViewController_Editor.cs.meta


fileFormatVersion: 2
guid: 5ae02437d98c0c24a850472d424da0f2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存