Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 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: 18 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,27 @@ 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;
color.a = 1f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In DisplacableRectHandles.baseColor we also have the same alpha values, can have them declared somewhere? Just in case we want to change them will be equal in both places. Maybe a static function SetAlphaHandleValues()?

m_MonochromeHandleColor = color;
color.a = 0.7f;
m_WireframeColor = color;
color.a = 0.2f;
m_WireframeColorBehind = 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
7 changes: 7 additions & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [11.0.0] - 2020-10-21

### Added

- Added pivot point manipulation for Decals (inspector and edit mode).
- Added UV manipulation for Decals (edit mode).
- Added color and intensity customization for Decals.

### Changed

- Removed the material pass probe volumes evaluation mode.

### Fixed
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. This arrow is on the pivot point.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base of this arrow is on the pivot point.

^^
Assumed its the base, ignore this comment if it isn't


![](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**|Move the pivot without moving the projection box. This alter the transform position.<br />Also, set the UV used on the projected texture.|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moves the decal's pivot point without moving the projection box. This changes the transform position.
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. Adjusting X and Y allows to make rotation of the projected texture around a specific position, while Z allows to have a specific offset in depth. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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