Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
26 changes: 26 additions & 0 deletions com.unity.render-pipelines.core/Editor/Gizmo/GizmoUtility.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using UnityEngine;

namespace UnityEditor.Rendering
{
public static class GizmoUtility
{
public static Color GetHandleColor(Color baseColor)
{
baseColor.a = 1f;
return baseColor;
}

public static Color GetWireframeColor(Color baseColor)
{
baseColor.a = .7f;
return baseColor;
}

public static Color GetWireframeColorBehindObjects(Color baseColor)
{
baseColor.a = .2f;
return baseColor;
}
}
}
11 changes: 11 additions & 0 deletions com.unity.render-pipelines.core/Editor/Gizmo/GizmoUtility.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 15 additions & 8 deletions com.unity.render-pipelines.core/Editor/Gizmo/HierarchicalBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,24 @@ public Color baseColor
set
{
value.a = 8f / 255;
m_MonochromeFillColor = value;
material.color = m_MonochromeFillColor;
value.a = 1f;
m_MonochromeHandleColor = value;
value.a = 0.7f;
m_WireframeColor = value;
value.a = 0.2f;
m_WireframeColorBehind = value;
SetBaseColor(value);
}
}

/// <summary>
/// Set the baseColor used to fill hull. All other colors are deduced from it except specific handle colors.
/// Instead of <see cref="baseColor">baseColor</see> set, this will not force the opacity and keep what is provided for the filled faces.
/// </summary>
/// <param name="color">The color to use</param>
public void SetBaseColor(Color color)
{
m_MonochromeFillColor = color;
material.color = m_MonochromeFillColor;
m_MonochromeHandleColor = GizmoUtility.GetHandleColor(color);
m_WireframeColor = GizmoUtility.GetWireframeColor(color);
m_WireframeColorBehind = GizmoUtility.GetWireframeColorBehindObjects(color);
}

//Note: Handles.Slider not allow to use a specific ControlID.
//Thus Slider1D is used (with reflection)
static Type k_Slider1D = Type.GetType("UnityEditorInternal.Slider1D, UnityEditor");
Expand Down
4 changes: 4 additions & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added
- Added support for the PlayStation 5 platform.
- Added pivot point manipulation for Decals (inspector and edit mode).
- Added UV manipulation for Decals (edit mode).
- Added color and intensity customization for Decals.

### Fixed
- Fixed GC allocations from XR occlusion mesh when using multipass.
Expand All @@ -33,6 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed issues with compositor's undo (cases 1305633, 1307170).

### Changed
- Removed the material pass probe volumes evaluation mode.
- Change the source value for the ray tracing frame index iterator from m_FrameCount to the camera frame count (case 1301356).

## [11.0.0] - 2020-10-21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,33 @@ The Decal Projector includes a Scene view representation of its bounds and proje

* A box that describes the 3D size of the projector; the projector draws its decal on every Material inside the box.

* An arrow that indicates the direction the projector faces.
* An arrow that indicates the direction the projector faces. The base of this arrow is on the pivot point.

![](Images/DecalProjector2.png)

The decal Projector also includes two gizmos that add handles on every face for you to click and drag to alter the size of the projector's bounds.
The decal Projector also includes three gizmos. The first two add handles on every face for you to click and drag to alter the size of the projector's bounds.

|**Button**|**Gizmo**|**Description**|
|-----|-----|-----|
|![](Images/DecalProjector3.png)|**Scale**|Scales the decal with the projector box. This changes the UVs of the Material to match the size of the projector box. This stretches the decal.|
|![](Images/DecalProjector4.png)|**Crop**|Crops the decal with the projector box. This changes the size of the projector box but not the UVs of the Material. This crops the decal.|
|![](Images/DecalProjector3.png)|**Scale**|Scales the decal with the projector box. This changes the UVs of the Material to match the size of the projector box. This stretches the decal. The Pivot remains still.|
|![](Images/DecalProjector4.png)|**Crop**|Crops the decal with the projector box. This changes the size of the projector box but not the UVs of the Material. This crops the decal. The Pivot remains still.|
|![](Images/DecalProjector5.png)|**Pivot / UV**|Moves the decal's pivot point without moving the projection box. This changes the transform position.<br/>Note this also sets the UV used on the projected texture.|

The color of the gizmos can be set up in the Preference window inside Color panel.

## Using the Inspector

Using the Inspector allows you to change all of the Decal Projector properties, and lets you use numerical values for **Size**, **Tiling**, and **Offset**, which allows for greater precision than the click-and-drag gizmo method.

## Properties

![](Images/DecalProjector5.png)
![](Images/DecalProjector6.png)

| **Property** | **Description** |
| ----------------------- | ------------------------------------------------------------ |
| **Size** | The size of the projector influence box, and thus the decal along the projected plane. The projector scales the decal to match the **Width** (along the local x-axis) and **Height** (along the local y-axis) components of the **Size**. |
| **Projection Depth** | The depth of the projector influence box. The projector scales the decal to match **Projection Depth**. The Decal Projector component projects decals along the local z-axis. |
| **Pivot** | The offset position of the transform regarding the projection box. To rotate the projected texture around a specific position, adjust the **X** and **Y** values. To set a depth offset for the projected texture, adjust the **Z** value. |
| **Material** | The decal Material to project. The decal Material must use a HDRP/Decal Shader. |
| **Decal Layer** | The layer that specifies the Materials to project the decal onto. Any Mesh Renderers or Terrain that uses a matching Decal Layer receives the decal. |
| **Draw Distance** | The distance from the Camera to the Decal at which this projector stops projecting the decal and HDRP no longer renders the decal. |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ partial class DecalProjectorEditor
{
const string k_EditShapePreservingUVTooltip = "Modifies the projector boundaries and crops/tiles the decal to fill them.";
const string k_EditShapeWithoutPreservingUVTooltip = "Modifies the projector boundaries and stretches the decal to fill them.";
const string k_EditUVTooltip = "Modify the UV positions only";
const string k_EditUVTooltip = "Modify the UV and the pivot position without moving the projection box. It can alter Transform.";

static readonly GUIContent k_SizeContent = EditorGUIUtility.TrTextContent("Size", "Sets the size of the projector.");
static readonly GUIContent[] k_SizeSubContent = new[]
Expand All @@ -24,16 +24,8 @@ partial class DecalProjectorEditor
static readonly GUIContent k_UVBiasContent = EditorGUIUtility.TrTextContent("Offset", "Sets the offset for the decal Material. Moves the decal along its UV axes.");
static readonly GUIContent k_FadeFactorContent = EditorGUIUtility.TrTextContent("Fade Factor", "Controls the transparency of the decal.");
static readonly GUIContent k_AffectTransparentContent = EditorGUIUtility.TrTextContent("Affects Transparent", "When enabled, HDRP draws this projector's decal on top of transparent surfaces.");
static readonly GUIContent k_Offset = EditorGUIUtility.TrTextContent("Pivot", "Controls the position of the pivot point of the decal.");

public static readonly Color k_GizmoColorBase = Color.white;
public static readonly Color[] k_BaseHandlesColor = new Color[]
{
Color.white,
Color.white,
Color.white,
Color.white,
Color.white,
Color.white
};
public static readonly Color k_GizmoColorBase = new Color(1, 1, 1, 8f / 255);
}
}
Loading