浏览代码
Merge pull request #890 from Unity-Technologies/Disable-Unused-camera-draw-mode
Merge pull request #890 from Unity-Technologies/Disable-Unused-camera-draw-mode
HDRenderPipeline: Disable Unused camera draw mode/main
GitHub
7 年前
当前提交
4c36ac1b
共有 3 个文件被更改,包括 66 次插入 和 6 次删除
-
17ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
-
44ScriptableRenderPipeline/HDRenderPipeline/HDRP/SceneViewDrawMode.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/SceneViewDrawMode.cs.meta
|
|||
#if UNITY_EDITOR
|
|||
using System.Collections; |
|||
using UnityEditor; |
|||
using UnityEditor.Experimental.Rendering; |
|||
|
|||
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() |
|||
{ |
|||
ArrayList sceneViewArray = SceneView.sceneViews; |
|||
foreach (SceneView sceneView in sceneViewArray) |
|||
sceneView.onValidateCameraMode += RejectDrawMode; |
|||
} |
|||
|
|||
static public void ResetDrawMode() |
|||
{ |
|||
ArrayList sceneViewArray = SceneView.sceneViews; |
|||
foreach (SceneView sceneView in sceneViewArray) |
|||
sceneView.onValidateCameraMode -= RejectDrawMode; |
|||
} |
|||
} |
|||
#endif
|
|
|||
fileFormatVersion: 2 |
|||
guid: 1ce13303c7796bd4d80d623d982e7460 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue