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

View Space Lighting Tool #2691

Merged
merged 77 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
d12f748
first commit
skhiat Nov 12, 2020
0643310
Adding UI Angles
skhiat Nov 16, 2020
68b4760
Backup
skhiat Nov 18, 2020
ea82a50
Test Version
skhiat Nov 18, 2020
fcac70c
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
skhiat Nov 19, 2020
1840ba5
Fix undocumented
skhiat Nov 19, 2020
15e34c1
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
skhiat Nov 19, 2020
614af80
Add Change Log & Doc
skhiat Nov 20, 2020
7902c81
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
skhiat Nov 20, 2020
b5d1f8a
Fix formating
skhiat Nov 20, 2020
539adf1
Updated images and manual doc
JordanL8 Nov 20, 2020
6223990
Added .md extensions to toc links
JordanL8 Nov 20, 2020
fd2515b
Improve API Doc
skhiat Nov 23, 2020
dc7d135
Merge branch 'HDRP/ViewSpaceLightingTool' of github.com:Unity-Technol…
skhiat Nov 23, 2020
5ae23b2
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
skhiat Nov 23, 2020
af325cc
Improves API Doc
skhiat Nov 23, 2020
55fed55
Improve the API Doc of ClickAction.cs
skhiat Nov 23, 2020
e5fb7ee
Updated documentation for CommandAction and made small tweaks to Clic…
JordanL8 Nov 23, 2020
d6499d0
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
skhiat Nov 23, 2020
a27e852
Merge branch 'HDRP/ViewSpaceLightingTool' of github.com:Unity-Technol…
skhiat Nov 23, 2020
25db119
Updated control docs and find and replace for gui state
JordanL8 Nov 23, 2020
46ab466
Merge branch 'HDRP/ViewSpaceLightingTool' of https://github.com/Unity…
JordanL8 Nov 23, 2020
42d5135
Doc review pass on DefaultControl, GenericControl, GenericDefaultCont…
JordanL8 Nov 23, 2020
3a85449
Improve UI
skhiat Nov 23, 2020
5848a91
Merge branch 'HDRP/ViewSpaceLightingTool' of github.com:Unity-Technol…
skhiat Nov 23, 2020
80887f3
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
skhiat Nov 23, 2020
a5b34f2
Update UI to have dropDown instead of toggle with boolean
skhiat Nov 24, 2020
02415e1
Reviewed GUIState
JordanL8 Nov 24, 2020
2e1d340
Reviewed GUISystem
JordanL8 Nov 24, 2020
f74aa0b
Reviewed handle manipulator
JordanL8 Nov 24, 2020
2eeac5f
Reviewed GUIState, HoveredControlAction, and IGUIState.
JordanL8 Nov 24, 2020
3940874
Reviewed LayoutData and SliderAction
JordanL8 Nov 24, 2020
11d857f
Change UI & doc
skhiat Nov 24, 2020
8111b05
Merge branch 'HDRP/ViewSpaceLightingTool' of github.com:Unity-Technol…
skhiat Nov 24, 2020
5f269b5
Removed interface references
JordanL8 Nov 24, 2020
25941d6
Merge branch 'HDRP/ViewSpaceLightingTool' of https://github.com/Unity…
JordanL8 Nov 24, 2020
4c93ef9
Update View-Lighting-Tool.md
JordanL8 Nov 24, 2020
cf348a1
Fix rounding issue
skhiat Nov 24, 2020
d0d0ca3
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
skhiat Nov 24, 2020
8d046f8
Fix color scheme (version 1.)
skhiat Nov 24, 2020
fd90c5e
Reviewed LightAnchror.cs
JordanL8 Nov 26, 2020
045bcd3
Reviewed LightAnchror.cs
JordanL8 Nov 26, 2020
fc3ec5c
Remove dependencies to GUIFramework & rename variables
skhiat Nov 30, 2020
1061638
Merge branch 'master' of https://github.com/Unity-Technologies/Graphi…
skhiat Nov 30, 2020
0e1ab7e
Update style dark & light mode
skhiat Nov 30, 2020
b73c386
Add new mode (wip) for Light Anchor
skhiat Dec 1, 2020
e5e22e3
Merge branch 'master' of https://github.com/Unity-Technologies/Graphi…
skhiat Dec 1, 2020
ee6fef9
Remove target with Anchor
skhiat Dec 1, 2020
2164d1b
Merge branch 'master' of https://github.com/Unity-Technologies/Graphi…
skhiat Dec 2, 2020
1f98b55
Fix formating
skhiat Dec 2, 2020
25a76aa
UX Pass + update image doc related to this change
skhiat Dec 4, 2020
f5d3679
Cleanup & remove unused functions
skhiat Dec 18, 2020
164be65
Cleanup & document behavior
skhiat Dec 18, 2020
26658cc
Proper message when setup is not done properly
skhiat Dec 18, 2020
01d0f9f
Fix missing icon
skhiat Dec 18, 2020
507a6b8
Fix doc url & tooltip
skhiat Dec 18, 2020
03f9a3c
Merge branch 'master' of https://github.com/Unity-Technologies/Graphi…
skhiat Dec 21, 2020
3b22b1c
Merge branch 'master' of https://github.com/Unity-Technologies/Graphi…
skhiat Jan 5, 2021
65c72eb
Rename axis
skhiat Jan 5, 2021
bc7ea7a
Merge branch 'master' of github.cds.internal.unity3d.com:unity/Graphi…
skhiat Jan 5, 2021
fb25274
Fix Undo Roll
skhiat Jan 5, 2021
b9ec74d
Fix light anchor flickering
skhiat Jan 5, 2021
b94db02
Fix missing icon
skhiat Jan 5, 2021
ee85895
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
skhiat Jan 6, 2021
b80c477
delete file
skhiat Jan 6, 2021
e3ffd3d
Fix edit euler angle by input field
skhiat Jan 6, 2021
a2b11d5
Fix build player
skhiat Jan 6, 2021
d6442f8
Disable multi-edit
skhiat Jan 6, 2021
dd04ac3
Remove unused function
skhiat Jan 12, 2021
a1bb9f9
Replace new GUIContent by EditorGUIUtility.TrTextContent
skhiat Jan 12, 2021
04f3724
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
skhiat Jan 12, 2021
ee0a29d
Replace new GUIContent to EditorGUIUtility.TrTextContent
skhiat Jan 12, 2021
a98b18d
Build fix & add tool top description for buttons common
skhiat Jan 12, 2021
335ee0a
Fix Undo UI for roll
skhiat Jan 12, 2021
7c01b3d
Fix build
skhiat Jan 13, 2021
5425163
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
skhiat Jan 13, 2021
696cb80
Fix Undo for Roll
skhiat Jan 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions com.unity.render-pipelines.core/CHANGELOG.md
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
Version Updated
The version number for this package has increased due to a version update of a related graphics package.

### Added
- New View Lighting Tool, a component which allow to setup light in the camera space

## [10.2.0] - 2020-10-19

Version Updated
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -13,7 +13,7 @@
* [RTHandle fundamentals](rthandle-system-fundamentals.md)
* [Using the RTHandle system](rthandle-system-using.md)


* [Look Dev](Look-Dev)
* [Environment Library](Look-Dev-Environment-Library)

* [Environment Library](Look-Dev-Environment-Library)
* [View Lighting Tool](View-Lighting-Tool)
@@ -0,0 +1,23 @@
# View Lighting Tool

View Lighting Tool is a tool that allow to setup lighting in the camera space. The main Camera (Game View) is used to setup the orientation of a light with spherical coordinate. We can choose a target and Yaw, Pitch and Roll (useful when a cookie or IES is setuped).
skhiat marked this conversation as resolved.
Show resolved Hide resolved

![](Images/ViewLightingTool00.png)

## Using View Lighting Tool
skhiat marked this conversation as resolved.
Show resolved Hide resolved

From a light we can add a component following Rendering > Light Anchor. Select the light on the light in the hierachy and enable the tool:
![](Images/ViewLightingTool01.png)

Which change the gizmo of the light to setup the target.
![](Images/ViewLightingTool02.gif)

On the inspector we can orient the light relative to this target and the main camera.
The distance:
![](Images/ViewLightingTool03.gif)

And the orientation:
![](Images/ViewLightingTool04.gif)

When a Cookie or an IES is setuped the last knob allow us to orient this one:
![](Images/ViewLightingTool05.gif)

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

@@ -0,0 +1,81 @@
using System;
using UnityEngine;

namespace UnityEditor
{
/// <summary>
/// Action for click
skhiat marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
public class ClickAction : HoveredControlAction
{
private int m_Button;
private bool m_UseEvent;
/// <summary>
/// Click count
skhiat marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
public int clickCount = 1;
/// <summary>
/// Action during onClick
skhiat marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
public Action<IGUIState, Control> onClick;
private int m_ClickCounter = 0;

/// <summary>
/// Constructor
/// </summary>
/// <param name="control">Current control</param>
/// <param name="button">Button ID</param>
skhiat marked this conversation as resolved.
Show resolved Hide resolved
/// <param name="useEvent">If use an event</param>
skhiat marked this conversation as resolved.
Show resolved Hide resolved
public ClickAction(Control control, int button, bool useEvent = true) : base(control)
{
m_Button = button;
m_UseEvent = useEvent;
}

/// <summary>
/// Get if the trigger condition is validated or not
skhiat marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
/// <param name="guiState">The gui state</param>
skhiat marked this conversation as resolved.
Show resolved Hide resolved
/// <returns></returns>
skhiat marked this conversation as resolved.
Show resolved Hide resolved
protected override bool GetTriggerCondition(IGUIState guiState)
{
if (guiState.mouseButton == m_Button && guiState.eventType == EventType.MouseDown)
{
if (guiState.clickCount == 1)
m_ClickCounter = 0;

++m_ClickCounter;

if (m_ClickCounter == clickCount)
return true;
}

return false;
}

/// <summary>
/// On trigger
/// </summary>
/// <param name="guiState">The gui state</param>
skhiat marked this conversation as resolved.
Show resolved Hide resolved
protected override void OnTrigger(IGUIState guiState)
{
base.OnTrigger(guiState);

if (onClick != null)
onClick(guiState, hoveredControl);

if (m_UseEvent)
guiState.UseEvent();
}

/// <summary>
/// Get Finish Condition
skhiat marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
/// <param name="guiState">The gui state</param>
skhiat marked this conversation as resolved.
Show resolved Hide resolved
/// <returns>Always true</returns>
skhiat marked this conversation as resolved.
Show resolved Hide resolved
protected override bool GetFinishCondition(IGUIState guiState)
{
return true;
}
}
}

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

@@ -0,0 +1,70 @@
using System;
using UnityEngine;

namespace UnityEditor
{
/// <summary>
/// Command Acction
/// </summary>
public class CommandAction : GUIAction
{
private string m_CommandName;

/// <summary>
/// The command
/// </summary>
public Action<IGUIState> onCommand;

/// <summary>
/// Constructor
/// </summary>
/// <param name="commandName">Command name</param>
public CommandAction(string commandName)
{
m_CommandName = commandName;
}

/// <summary>
/// Get trigger condition
/// </summary>
/// <param name="guiState">The GUI State</param>
/// <returns>true if the trigger condition is validated</returns>
protected override bool GetTriggerCondition(IGUIState guiState)
{
if (guiState.eventType == EventType.ValidateCommand && guiState.commandName == m_CommandName)
{
guiState.UseEvent();
return true;
}

return false;
}

/// <summary>
/// Get finish conditions
/// </summary>
/// <param name="guiState">The gui state</param>
/// <returns>true if the trigger condition is finished</returns>
protected override bool GetFinishCondition(IGUIState guiState)
{
if (guiState.eventType == EventType.ExecuteCommand && guiState.commandName == m_CommandName)
{
guiState.UseEvent();

return true;
}

return false;
}

/// <summary>
/// On finish
/// </summary>
/// <param name="guiState">The gui state</param>
protected override void OnFinish(IGUIState guiState)
{
if (onCommand != null)
onCommand(guiState);
}
}
}

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