浏览代码

Added the possibility to hide opaque or transparent objects

/main
Julien Ignace 8 年前
当前提交
2a66fcda
共有 3 个文件被更改,包括 21 次插入24 次删除
  1. 32
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  2. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoopInspector.cs
  3. 4
      Assets/TestScenes/HDTest/EnlightenTest.unity

32
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


public class DebugParameters
{
// Material Debugging
private MaterialDebugMode m_MaterialDebugMode = MaterialDebugMode.None;
private GBufferDebugMode m_GBufferDebugMode = GBufferDebugMode.None;
private bool m_DisplayMaterialDebugForTransparent = false;
public MaterialDebugMode materialDebugMode
{
get { return m_MaterialDebugMode; }
set { m_MaterialDebugMode = value; }
}
public GBufferDebugMode gBufferDebugMode
{
get { return m_GBufferDebugMode; }
set { m_GBufferDebugMode = value; }
}
public MaterialDebugMode materialDebugMode = MaterialDebugMode.None;
public GBufferDebugMode gBufferDebugMode = GBufferDebugMode.None;
public bool displayMaterialDebugForTransparent = false;
public bool displayMaterialDebugForTransparent
{
get { return m_DisplayMaterialDebugForTransparent; }
set { m_DisplayMaterialDebugForTransparent = value; }
}
// Rendering debugging
public bool displayOpaqueObjects = true;
public bool displayTransparentObjects = true;
}
private DebugParameters m_DebugParameters = new DebugParameters();

InitAndClearBuffer(camera, renderLoop);
RenderGBuffer(cullResults, camera, renderLoop);
if(debugParameters.displayOpaqueObjects)
RenderGBuffer(cullResults, camera, renderLoop);
RenderForward(cullResults, camera, renderLoop);
if(debugParameters.displayTransparentObjects)
RenderForward(cullResults, camera, renderLoop);
if (debugParameters.gBufferDebugMode != GBufferDebugMode.None)
{

9
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoopInspector.cs


public readonly GUIContent transparentMaterialDebugMode = new GUIContent("Transparent Material Debug", "Display material debug for transparent objects.");
public readonly GUIContent gBufferDebugMode = new GUIContent("GBuffer Debug Mode", "Display various properties of contained in the GBuffer.");
public readonly GUIContent displayOpaqueObjects = new GUIContent("Display Opaque Objects", "Toggle opaque objects rendering on and off.");
public readonly GUIContent displayTransparentObjects = new GUIContent("Display Transparent Objects", "Toggle transparent objects rendering on and off.");
public readonly GUIContent[] materialDebugStrings = { new GUIContent("None"),
new GUIContent("Diffuse Color"),
new GUIContent("Normal"),

EditorGUILayout.LabelField(styles.debugParameters);
EditorGUI.indentLevel++;
EditorGUI.BeginChangeCheck();
EditorGUILayout.Space();
debugParameters.displayOpaqueObjects = EditorGUILayout.Toggle(styles.displayOpaqueObjects, debugParameters.displayOpaqueObjects);
debugParameters.displayTransparentObjects = EditorGUILayout.Toggle(styles.displayTransparentObjects, debugParameters.displayTransparentObjects);
if(EditorGUI.EndChangeCheck())
{
EditorUtility.SetDirty(renderLoop); // Repaint

4
Assets/TestScenes/HDTest/EnlightenTest.unity


m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 399229766}
m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068}
m_LocalPosition: {x: 11.47, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 11.47, y: 0.99, z: -2.72}
m_LocalScale: {x: 0.7180612, y: 1, z: 2.3734639}
m_Children: []
m_Father: {fileID: 1027688891}
m_RootOrder: 4

正在加载...
取消
保存