Upload project file
This commit is contained in:
35
Runtime/HDRP/UTS Renderer/Debug/UTSDebug.cs
Normal file
35
Runtime/HDRP/UTS Renderer/Debug/UTSDebug.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace Unity.Toonshader
|
||||
{
|
||||
[GenerateHLSL]
|
||||
public enum UTS_BSDFDebug
|
||||
{
|
||||
None,
|
||||
BaseColor,
|
||||
Normal,
|
||||
Smoothness,
|
||||
Metallic,
|
||||
AmbientOcclusion,
|
||||
SpecularOcclusion,
|
||||
SpecularColor,
|
||||
Anisotropy,
|
||||
HairRoughness,
|
||||
NormalWS,
|
||||
}
|
||||
|
||||
[GenerateHLSL]
|
||||
public enum UTS_LightingDebug
|
||||
{
|
||||
None,
|
||||
DiffuseLighting,
|
||||
SpecularLighting,
|
||||
DirectDiffuseLighting,
|
||||
DirectSpecularLighting,
|
||||
IndirectDiffuseLighting,
|
||||
IndirectSpecularLighting,
|
||||
IndirectDiffuseOcclusion,
|
||||
IndirectSpecularOcclusion,
|
||||
Emission,
|
||||
}
|
||||
}
|
||||
23
Runtime/HDRP/UTS Renderer/Debug/UTSDebug.cs.hlsl
Normal file
23
Runtime/HDRP/UTS Renderer/Debug/UTSDebug.cs.hlsl
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// This file was automatically generated. Please don't edit by hand. Execute Editor command [ Edit > Rendering > Generate Shader Includes ] instead
|
||||
//
|
||||
|
||||
#ifndef UTSDEBUG_CS_HLSL
|
||||
#define UTSDEBUG_CS_HLSL
|
||||
//
|
||||
// Unity.Toonshader.UTS_BSDFDebug: static fields
|
||||
//
|
||||
#define UTS_BSDFDEBUG_NONE (0)
|
||||
#define UTS_BSDFDEBUG_BASE_COLOR (1)
|
||||
#define UTS_BSDFDEBUG_NORMAL (2)
|
||||
#define UTS_BSDFDEBUG_SMOOTHNESS (3)
|
||||
#define UTS_BSDFDEBUG_METALLIC (4)
|
||||
#define UTS_BSDFDEBUG_AMBIENT_OCCLUSION (5)
|
||||
#define UTS_BSDFDEBUG_SPECULAR_OCCLUSION (6)
|
||||
#define UTS_BSDFDEBUG_SPECULAR_COLOR (7)
|
||||
#define UTS_BSDFDEBUG_ANISOTROPY (8)
|
||||
#define UTS_BSDFDEBUG_HAIR_ROUGHNESS (9)
|
||||
#define UTS_BSDFDEBUG_NORMAL_WS (10)
|
||||
|
||||
|
||||
#endif
|
||||
7
Runtime/HDRP/UTS Renderer/Debug/UTSDebug.cs.hlsl.meta
Normal file
7
Runtime/HDRP/UTS Renderer/Debug/UTSDebug.cs.hlsl.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc640c6ba1e3c3f418daf7da8178510a
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
11
Runtime/HDRP/UTS Renderer/Debug/UTSDebug.cs.meta
Normal file
11
Runtime/HDRP/UTS Renderer/Debug/UTSDebug.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07ff7a966a4fee6498485046a71fcce7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
71
Runtime/HDRP/UTS Renderer/Debug/UTSDebugPanel.cs
Normal file
71
Runtime/HDRP/UTS Renderer/Debug/UTSDebugPanel.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace Unity.Toonshader
|
||||
{
|
||||
public static class UTSDebugPanel
|
||||
{
|
||||
static bool isPanelEnabled = false;
|
||||
|
||||
static UTS_BSDFDebug uTS_BSDFData = UTS_BSDFDebug.None;
|
||||
static UTS_LightingDebug uTS_LightingData = UTS_LightingDebug.None;
|
||||
|
||||
public static void OnEnable()
|
||||
{
|
||||
if (isPanelEnabled)
|
||||
return;
|
||||
|
||||
// Create a list of widgets
|
||||
List<DebugUI.Widget> widgetList = new List<DebugUI.Widget>();
|
||||
|
||||
// Add a checkbox widget to the list of widgets
|
||||
widgetList.AddRange(new DebugUI.Widget[]
|
||||
{
|
||||
new DebugUI.EnumField
|
||||
{
|
||||
displayName = "BSDF debug mode",
|
||||
tooltip = "Select a bsdf debug mode",
|
||||
getter = () => (int)uTS_BSDFData,
|
||||
setter = value => uTS_BSDFData = (UTS_BSDFDebug)value,
|
||||
getIndex = () => (int)uTS_BSDFData,
|
||||
setIndex = value => uTS_BSDFData = (UTS_BSDFDebug)value,
|
||||
autoEnum = typeof(UTS_BSDFDebug), onValueChanged = BSDFDebugChanged
|
||||
},
|
||||
new DebugUI.EnumField
|
||||
{
|
||||
displayName = "Lighting debug mode",
|
||||
tooltip = "Select a lighting debug mode",
|
||||
getter = () => (int)uTS_LightingData,
|
||||
setter = value => uTS_LightingData = (UTS_LightingDebug)value,
|
||||
getIndex = () => (int)uTS_LightingData,
|
||||
setIndex = value => uTS_LightingData = (UTS_LightingDebug)value,
|
||||
autoEnum = typeof(UTS_LightingDebug), onValueChanged = LightingDebugChanged
|
||||
},
|
||||
});
|
||||
|
||||
// Create a new panel (tab) in the Rendering Debugger
|
||||
DebugUI.Panel panel = DebugManager.instance.GetPanel("UTS", createIfNull: true);
|
||||
|
||||
// Add the widgets to the panel
|
||||
panel.children.Add(widgetList.ToArray());
|
||||
isPanelEnabled = true;
|
||||
}
|
||||
|
||||
private static void BSDFDebugChanged(DebugUI.Field<int> field, int arg2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private static void LightingDebugChanged(DebugUI.Field<int> field, int arg2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Remove the custom panel if the GameObject is disabled
|
||||
public static void OnDisable()
|
||||
{
|
||||
DebugManager.instance.RemovePanel("UTS");
|
||||
isPanelEnabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Runtime/HDRP/UTS Renderer/Debug/UTSDebugPanel.cs.meta
Normal file
11
Runtime/HDRP/UTS Renderer/Debug/UTSDebugPanel.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3670f54e2c33a144ebc55e56e207d69d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user