Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed gizmos no longer allocate memory in game view #4676

Merged
merged 2 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed gizmos no longer allocate memory in game view. [case 1328852]
  • Loading branch information
lukaschod committed May 27, 2021
commit 9b48e7f013939a068e67eff909fc68494894f577
1 change: 1 addition & 0 deletions com.unity.render-pipelines.universal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed shaderGraph shaders to render into correct depthNormals passes when deferred rendering mode and SSAO are enabled.
- Fixed ordering of subshaders in the Unlit Shader Graph, such that shader target 4.5 takes priority over 2.0. [case 1328636](https://issuetracker.unity3d.com/product/unity/issues/guid/1328636/)
- Fixed issue where it will clear camera color if post processing is happening on XR [case 1324451]
- Fixed gizmos no longer allocate memory in game view. [case 1328852]

### Changed
- Change Asset/Create/Shader/Universal Render Pipeline/Lit Shader Graph to Asset/Create/Shader Graph/URP/Lit Shader Graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ public static string GetName(this CameraRenderType type)
[ImageEffectAllowedInSceneView]
public class UniversalAdditionalCameraData : MonoBehaviour, ISerializationCallbackReceiver
{
const string k_GizmoPath = "Packages/com.unity.render-pipelines.universal/Editor/Gizmos/";
const string k_BaseCameraGizmoPath = k_GizmoPath + "Camera_Base.png";
const string k_OverlayCameraGizmoPath = k_GizmoPath + "Camera_Base.png";
const string k_PostProcessingGizmoPath = k_GizmoPath + "Camera_PostProcessing.png";

[FormerlySerializedAs("renderShadows"), SerializeField]
bool m_RenderShadows = true;

Expand Down Expand Up @@ -562,17 +567,16 @@ public void OnAfterDeserialize()

public void OnDrawGizmos()
{
string path = "Packages/com.unity.render-pipelines.universal/Editor/Gizmos/";
string gizmoName = "";
Color tint = Color.white;

if (m_CameraType == CameraRenderType.Base)
{
gizmoName = $"{path}Camera_Base.png";
gizmoName = k_BaseCameraGizmoPath;
}
else if (m_CameraType == CameraRenderType.Overlay)
{
gizmoName = $"{path}Camera_Overlay.png";
gizmoName = k_OverlayCameraGizmoPath;
}

#if UNITY_2019_2_OR_NEWER
Expand All @@ -590,12 +594,12 @@ public void OnDrawGizmos()

if (renderPostProcessing)
{
Gizmos.DrawIcon(transform.position, $"{path}Camera_PostProcessing.png", true, tint);
Gizmos.DrawIcon(transform.position, k_PostProcessingGizmoPath, true, tint);
}
#else
if (renderPostProcessing)
{
Gizmos.DrawIcon(transform.position, $"{path}Camera_PostProcessing.png");
Gizmos.DrawIcon(transform.position, k_PostProcessingGizmoPath);
}
Gizmos.DrawIcon(transform.position, gizmoName);
#endif
Expand Down