浏览代码
Hdrp/fix/light gizmos and handles (#1905)
Hdrp/fix/light gizmos and handles (#1905)
Hide legacy gizmo for all spot lights and introduce pyramid and box light handle. (Cone spot light handle should be branched once validated in LW)/hdrp-staging
JulienIgnace-Unity
6 年前
当前提交
195a1aa2
共有 5 个文件被更改,包括 403 次插入 和 175 次删除
-
341com.unity.render-pipelines.core/CoreRP/Editor/Lighting/CoreLightEditorUtilities.cs
-
66com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDAdditionalLightDataEditor.cs
-
126com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditor.cs
-
34com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditorUtilities.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditorUtilities.cs.meta
|
|||
using System; |
|||
using System.Reflection; |
|||
using UnityEditor; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public static class HDLightEditorUtilities |
|||
{ |
|||
public static void DrawFrustumlightGizmo(Light frustumlight) |
|||
{ |
|||
var additionalLightData = frustumlight.GetComponent<HDAdditionalLightData>(); |
|||
if (additionalLightData == null) |
|||
return; |
|||
|
|||
Matrix4x4 matrix = new Matrix4x4(frustumlight.transform.right, frustumlight.transform.up, frustumlight.transform.forward, frustumlight.transform.position); |
|||
Gizmos.matrix = matrix; |
|||
if (additionalLightData.spotLightShape == SpotLightShape.Pyramid) |
|||
{ |
|||
CoreLightEditorUtilities.DrawLightPyramidFrustum(Vector3.zero, frustumlight.spotAngle, frustumlight.range, 0.0f, additionalLightData.aspectRatio); |
|||
} |
|||
else // Ortho frustum
|
|||
{ |
|||
//DrawLightOrthoFrustum(Vector3.zero, additionalLightData.shapeWidth, additionalLightData.shapeHeight, frustumlight.range, 0.0f);
|
|||
|
|||
Vector3 frustumCenter = new Vector3(0.0f, 0.0f, 0.5f * frustumlight.range); |
|||
Vector3 frustumsize = new Vector3(additionalLightData.shapeWidth, additionalLightData.shapeHeight, frustumlight.range); |
|||
Gizmos.DrawWireCube(frustumCenter, frustumsize); |
|||
} |
|||
Gizmos.matrix = Matrix4x4.identity; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: ef4691ff5d1cc1f4c9d444b14135a45d |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue