Skip to content

Commit e9dcd7a

Browse files
sebastienlagardeemilybrown1FrancescoC-unityanisunityJulienIgnace-Unity
committed
[HDRP 21.2] Backport various PRs (#6926)
* fixed typo and made style guide fixes (#6749) * style guide fixes (#6750) * Added menu trail to change atlas resolution (#6755) * Clarified how to find hdrp in package manager (#6756) * made style guide fixes (#6762) * added new instructions for photoshop colour channels (#6769) * made naming of AO consistent (#6771) * Removed reference to 3d with extras project (#6781) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Added default value (#6770) * Added default value * Fixed merge issue * undo wrong fix Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Merge Hd/bugfix #6791 * Fix warning on baking set renaming #6808 * Renamed the Exposure field to Exposure Compensation in sky volume overrides (case 1392530). #6801 * Refresh baking set scene list when one baking set is removed. #6811 * clarified how to change mode (#6871) * fixed screenshot annotation colour (#6872) * fixed formatting (#6873) * fixed name of Game view (#6874) * fixed note formatting (#6875) * new screenshot and fixed table formatting (#6889) * minor style guide changes (#6904) * remove italics, note formatting (#6906) * fixed typo "on following GPUs" > on the following GPUs (#6909) * Post Process can now be edited in the default frame settings. #6816 * Fixed errors spamming when in player mode due to ray tracing light cluster debug view (case 1390471). #6820 * Fixed missing unit in ray tracing related tooltips and docs (case 1397491). #6822 * [Fogbugz # 1386436] Fixing FPTL failing when near and far are very tight. #6826 * Fixed an issue where forced sky update would not update ambient probe. #6831 * Fixed a null ref exception in Volume Explorer #6834 * Cleaning up FPTL early out for ps4 and PC (#6882) * Changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [HDRP] Fix static sky lighting update when render textures are updated #6863 * Quality update of custom post process (#6856) * Disable the clouds in the indoor sample scenes (normal and DXR) #6908 * Fixed using the wrong coordinate to compute the sampling direction for the screen space global illumination. #6903 * Update VolumeParameter.cs * Replaced view lighting tool with light anchor (#6829) * Replaced view lighting tool with light anchor * Update View-Lighting-Tool.md * Apply formatting changes * revert: Fix cached directional shadows disappearing when going out of shadow range to never reappear #6802 * [RPW][1386964]Fix undo for DebugUI.Enum fields on the rendering debugger. #6632 * More explicit error message when trying to use Shader Graph nodes HDSceneColor, NormalFromHeight, DDX, DDY or DDXY in ray tracing #6254 * [RPW]Fix recovering the correct index for DebugUI.Enum field that are not autoenum (#6901) * Proper Indoors scene template volume * Update 004-CloudsFlaresDecals.png Co-authored-by: emilybrown1 <88374601+emilybrown1@users.noreply.github.com> Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Co-authored-by: anisunity <42026998+anisunity@users.noreply.github.com> Co-authored-by: JulienIgnace-Unity <julien@unity3d.com> Co-authored-by: Kleber Garcia <kleber.garcia@unity3d.com> Co-authored-by: Antoine Lelievre <antoinel@unity3d.com> Co-authored-by: noreply@unity3d.com <noreply@unity3d.com> Co-authored-by: alex-vazquez <76204843+alex-vazquez@users.noreply.github.com> Co-authored-by: Emmanuel Turquin <emmanuel@turquin.org> Co-authored-by: Rémi Chapelain <remi.chapelain@unity3d.com>
1 parent 0514289 commit e9dcd7a

File tree

85 files changed

+1932
-622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1932
-622
lines changed
Loading

com.unity.render-pipelines.core/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [13.1.6] - 2022-01-14
88

9-
Version Updated
10-
The version number for this package has increased due to a version update of a related graphics package.
9+
### Fixed
10+
- Fixed undo in for `DebugUI.EnumFields` on the rendering debugger. (case 1386964)
1111

1212
## [13.1.5] - 2021-12-17
1313

Lines changed: 2 additions & 2 deletions
Loading

com.unity.render-pipelines.core/Documentation~/TableOfContents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
* [Synchronizing shader code and C#](generating-shader-includes.md)
1616
* [Look Dev](Look-Dev.md)
1717
* [Environment Library](Look-Dev-Environment-Library.md)
18-
* [View Lighting Tool](view-lighting-tool.md)
18+
* [Light Anchor](view-lighting-tool.md)
Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
1-
## View Lighting tool
1+
## Light Anchor
22

3-
The View Lighting tool allows you to set up lighting in camera space. It uses the main Camera (the one that renders to the Game view) to set the orientation of the Light using spherical coordinates, and it uses a target and distance to set the position of the Light.
3+
The Light Anchor can help to place light sources around subjects, in relation to a Camera and an anchor point. It's particularly effective for cinematic lighting, which often requires multiple light sources orbiting a subject.
44

5-
Since the View Lighting tool uses camera-space, it is especially useful when setting up lighting for cinematics.
5+
## Using the Light Anchor Component
66

7-
To be able to use the view lighting tool, we need to have at least one camera tagged as "MainCamera" (only one will be used).
7+
To use the Light Anchor, you must set the Tag of at least one Camera to "MainCamera". By default, the Anchor's position will be the same as the position of the GameObject the Light Anchor Component is attached to.
88

9-
## Using the View Lighting tool
9+
Use the **Orbit** and **Elevation** to control the orientation of the light, in degrees, relative to the main Camera's and Anchor's positions. If the Light has a Cookie or an IES Profile, use the **Roll** to change their orientation. Use the **Distance** to control how far from the anchor, in meters, you want to place the Light.
1010

11-
The View Lighting tool uses the Light Anchor component to position and orient the Light. When this component is attached to a Light, you can use a custom Scene view gizmo to position the Light, and use the component's Inspector to orient the Light.
11+
Using the **Anchor Position Override**, you can provide a custom GameObject as an anchor point for the light. This is useful if you want the light to follow a specific GameObject in the Scene.
1212

13-
To get started with the View Lighting tool:
14-
15-
1. In the Scene view or Hierarchy, select a GameObject with an attached Light component.
16-
2. In the Inspector click **Add Component > Rendering > Light Anchor**.
17-
3. To use the Light Anchor gizmo, click the custom tool button then, in the drop-down, click **Light Anchor**.<br/>![](Images/view-lighting-tool-gizmo.png)
18-
4. You can now use the gizmo to move the Light's target. This gizmo also shows you a visualization of the yaw, pitch, and roll from the target to the Light. To change the yaw, pitch, and roll, as well as the distance from the Light to the target, see [Light Anchor](#light-anchor).
19-
20-
### Light Anchor
21-
22-
The Light Anchor controls the Light's orientation and the distance it is from the target position. **Yaw** and **Pitch** control the orientation and **Distance** controls the distance between the Light and the target. If the Light has a cookie or uses [IES](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/IES-Profile.html), **Roll** controls the orientation of the cookie or IES profile.
23-
24-
To quickly reset the angle of a knob to zero. Right-click on it.
13+
You can set a **Position Offset** for this custom Anchor. This is useful if the Transform position of the custom Anchor isn't centered appropriately for the light to orbit correctly around the custom Anchor.
2514

2615
![](Images/view-lighting-tool-light-anchor0.png)
2716

28-
The Light Anchor component also includes a list of **Presets** that you can use to quickly set the Light's orientation relative to the Game view.
17+
The Light Anchor component also includes a list of **Presets** that you can use to set the Light's orientation relative to the main Camera.

com.unity.render-pipelines.core/Editor/Debugging/DebugState.cs

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,52 @@ public DebugStateAttribute(params Type[] types)
134134
[Serializable, DebugState(typeof(DebugUI.BoolField), typeof(DebugUI.Foldout), typeof(DebugUI.HistoryBoolField))]
135135
public sealed class DebugStateBool : DebugState<bool> { }
136136

137+
/// <summary>
138+
/// Enums Debug State.
139+
/// </summary>
140+
[Serializable, DebugState(typeof(DebugUI.EnumField), typeof(DebugUI.HistoryEnumField))]
141+
public sealed class DebugStateEnum : DebugState<int>, ISerializationCallbackReceiver
142+
{
143+
DebugUI.EnumField m_EnumField;
144+
145+
/// <summary>
146+
/// Set the value of the Debug Item.
147+
/// </summary>
148+
/// <param name="value">Input value.</param>
149+
/// <param name="field">Debug Item field.</param>
150+
public override void SetValue(object value, DebugUI.IValueField field)
151+
{
152+
m_EnumField = field as DebugUI.EnumField;
153+
base.SetValue(value, field);
154+
}
155+
156+
void UpdateValue()
157+
{
158+
if (m_EnumField != null)
159+
{
160+
base.SetValue(value, m_EnumField);
161+
// There might be cases that the value does not map the index, look for the correct index
162+
var newCurrentIndex = Array.IndexOf(m_EnumField.enumValues, value);
163+
if (m_EnumField.currentIndex != newCurrentIndex)
164+
m_EnumField.currentIndex = newCurrentIndex;
165+
}
166+
}
167+
168+
/// <summary>
169+
/// On Before Serialize Callback
170+
/// </summary>
171+
public void OnBeforeSerialize() => UpdateValue();
172+
173+
/// <summary>
174+
/// On After Deserialize Callback
175+
/// </summary>
176+
public void OnAfterDeserialize() => UpdateValue();
177+
}
178+
137179
/// <summary>
138180
/// Integer Debug State.
139181
/// </summary>
140-
[Serializable, DebugState(typeof(DebugUI.IntField), typeof(DebugUI.EnumField), typeof(DebugUI.HistoryEnumField))]
182+
[Serializable, DebugState(typeof(DebugUI.IntField))]
141183
public sealed class DebugStateInt : DebugState<int> { }
142184

143185
/// <summary>

com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public sealed class DebugUIDrawerEnumField : DebugUIDrawer
304304
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
305305
{
306306
var w = Cast<DebugUI.EnumField>(widget);
307-
var s = Cast<DebugStateInt>(state);
307+
var s = Cast<DebugStateEnum>(state);
308308

309309
if (w.indexes == null)
310310
w.InitIndexes();

com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public virtual void End(DebugUI.Widget widget, DebugState state)
8181
/// <param name="value">Input value.</param>
8282
protected void Apply(DebugUI.IValueField widget, DebugState state, object value)
8383
{
84-
Undo.RegisterCompleteObjectUndo(state, "Debug Property Change");
84+
Undo.RegisterCompleteObjectUndo(state, $"Debug Property '{state.queryPath}' Change");
8585
state.SetValue(value, widget);
8686
widget.SetValue(value);
8787
EditorUtility.SetDirty(state);

com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void OnGUI()
422422
GUI.Toggle(elementRect, m_Settings.selectedPanel == i, panel.displayName, s_Styles.sectionElement);
423423
if (EditorGUI.EndChangeCheck())
424424
{
425-
Undo.RegisterCompleteObjectUndo(m_Settings, "Debug Panel Selection");
425+
Undo.RegisterCompleteObjectUndo(m_Settings, $"Debug Panel '{panel.displayName}' Selection");
426426
var previousPanel = m_Settings.selectedPanel >= 0 && m_Settings.selectedPanel < panels.Count
427427
? panels[m_Settings.selectedPanel]
428428
: null;

com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeBakingWindow.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ void InitializeBakingSetList()
131131
m_RenameSelectedBakingSet = false;
132132

133133
// Rename profile asset to match name:
134-
set.profile.name = set.name;
135134
AssetDatabase.RenameAsset(AssetDatabase.GetAssetPath(set.profile), set.name);
135+
set.profile.name = set.name;
136136
}
137137
}
138138
else
@@ -163,6 +163,9 @@ void InitializeBakingSetList()
163163
AssetDatabase.DeleteAsset(pathToDelete);
164164
Undo.RegisterCompleteObjectUndo(sceneData.parentAsset, "Deleted baking set");
165165
ReorderableList.defaultBehaviours.DoRemoveButton(list);
166+
// A new set will be selected automatically, so we perform the same operations as if we did the selection explicitly.
167+
OnBakingSetSelected(m_BakingSets);
168+
166169
}
167170
};
168171

0 commit comments

Comments
 (0)