浏览代码

HDRenderPipeline: Disable Unused camera draw mode

/main
sebastienlagarde 7 年前
当前提交
e9d63252
共有 1 个文件被更改,包括 53 次插入5 次删除
  1. 58
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs

58
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


using System.Diagnostics;
using System.Linq;
using UnityEngine.Rendering.PostProcessing;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Experimental.Rendering;
#endif
namespace UnityEngine.Experimental.Rendering.HDPipeline
{

}
}
#if UNITY_EDITOR
public class SceneViewDrawMode
{
static private bool RejectDrawMode(SceneView.CameraMode cameraMode)
{
if (cameraMode.drawMode == DrawCameraMode.TexturedWire ||
cameraMode.drawMode == DrawCameraMode.ShadowCascades ||
cameraMode.drawMode == DrawCameraMode.RenderPaths ||
cameraMode.drawMode == DrawCameraMode.AlphaChannel ||
cameraMode.drawMode == DrawCameraMode.Overdraw ||
cameraMode.drawMode == DrawCameraMode.Mipmaps ||
cameraMode.drawMode == DrawCameraMode.DeferredDiffuse ||
cameraMode.drawMode == DrawCameraMode.DeferredSpecular ||
cameraMode.drawMode == DrawCameraMode.DeferredSmoothness ||
cameraMode.drawMode == DrawCameraMode.DeferredNormal ||
cameraMode.drawMode == DrawCameraMode.ValidateAlbedo ||
cameraMode.drawMode == DrawCameraMode.ValidateMetalSpecular ||
cameraMode.drawMode == DrawCameraMode.ShadowMasks ||
cameraMode.drawMode == DrawCameraMode.LightOverlap
)
return false;
return true;
}
static public void SetupDrawMode()
{
SceneView sceneView = EditorWindow.GetWindow<SceneView>();
sceneView.onValidateCameraMode += RejectDrawMode;
}
static public void ResetDrawMode()
{
SceneView sceneView = EditorWindow.GetWindow<SceneView>();
sceneView.onValidateCameraMode -= RejectDrawMode;
}
}
#endif
public class HDRenderPipeline : RenderPipeline
{

rendererSupportsReceiveShadows = true,
rendererSupportsReflectionProbes = true
};
#if UNITY_EDITOR
SceneViewDrawMode.SetupDrawMode();
#endif
}
void InitializeDebugMaterials()

m_VolumetricLightingModule.Cleanup();
SupportedRenderingFeatures.active = new SupportedRenderingFeatures();
#if UNITY_EDITOR
SceneViewDrawMode.ResetDrawMode();
#endif
}
void CreateDepthStencilBuffer(HDCamera hdCamera)

m_LightLoop.UpdateCullingParameters(ref cullingParams);
#if UNITY_EDITOR
#endif
// decal system needs to be updated with current camera
if (m_FrameSettings.enableDBuffer)
DecalSystem.instance.BeginCull(camera);

// Make sure to unbind every render texture here because in the next iteration of the loop we might have to reallocate render texture (if the camera size is different)
cmd.SetRenderTarget(new RenderTargetIdentifier(-1), new RenderTargetIdentifier(-1));
#if UNITY_EDITOR
{
#endif
}
}
// Caution: ExecuteCommandBuffer must be outside of the profiling bracket

正在加载...
取消
保存