Skip to content

HDRP/Fix package version showing package after the last "verified" package #2783

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

Merged
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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- Removed the material pass probe volumes evaluation mode.
- Volume parameter of type Cubemap can now accept Cubemap render textures and custom render textures.
- Replaced last package version checker in Wizard to a link on Package Manager

## [10.3.0] - 2020-12-01

Expand Down
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 @@ -8,16 +8,15 @@ To open the **Render Pipeline Wizard**, go to **Window > Render Pipeline** and s

## Packages

At the top of the window, there is an information box that shows you the currently installed version of HDRP, as well as the latest version of HDRP that is compatible with your current Unity version.
At the top of the window, there is an information text that shows you the currently installed version of HDRP. The **Check Update** button provides a shortcut to the HDRP package in the Package Manager window.

You also have a button allow you to creates a local instance of the [High Definition Render Pipeline Config package](HDRP-Config-Package.md) in the **LocalPackage** folder of your HDRP Project. If already installed, some information about its location are displayed below.

## Default Path Settings

| **Property** | **Description** |
| ------------------------------------------ | ------------------------------------------------------------ |
| **Default Resources Folder** | Set the folder name that the Render Pipeline Wizard uses when it loads or creates resources. Click the **Populate / Reset** button to populate the **Default Resources Folder** with the resources that HDRP needs to render a Scene (for details, see [Populating the default resources folder](#populating-the-default-resources-folder)). If a default Asset already exists in the folder then clicking the Populate/Reset button resets the existing Asset. |
| **Install Configuration Editable Package** | Creates a local instance of the [High Definition Render Pipeline Config package](HDRP-Config-Package.md) in the **LocalPackage** folder of your HDRP Project. |
| **Property** | **Description** |
| ---------------------------- | ------------------------------------------------------------ |
| **Default Resources Folder** | Set the folder name that the Render Pipeline Wizard uses when it loads or creates resources. Click the **Populate / Reset** button to populate the **Default Resources Folder** with the resources that HDRP needs to render a Scene (for details, see [Populating the default resources folder](#populating-the-default-resources-folder)). If a default Asset already exists in the folder then clicking the Populate/Reset button resets the existing Asset. |

### Populating the default resources folder

Expand Down Expand Up @@ -54,6 +53,7 @@ This tab provides you with configuration options to help you make your Unity Pro
| **- Assigned** | Checks to make sure you have assigned an [HDRP Asset](HDRP-Asset.md) to the **Scriptable Render Pipeline Settings** field (menu: **Edit** > **Project Settings** > **Graphics**).<br />Press the **Fix** button to open a pop-up that allows you to either assign an HDRP Asset or create and assign a new one. |
| **- Runtime Resources** | Checks to make sure that your HDRP Asset references a [**Render Pipeline Resources**](HDRP-Asset.md) Asset.<br />Press the **Fix** button to reload the runtime resources for the HDRP Asset. |
| **- Editor Resources** | Checks to make sure that your HDRP Asset references a [**Render Pipeline Editor Resources**](HDRP-Asset.md) Asset.<br />Press the **Fix** button to reload the runtime resources for the HDRP Asset. |
| **- SRP Batcher** | Checks to make sure that SRP Batcher is enabled.<br />Press the **Fix** button to enable it in the used HDRP Asset. |
| **- Diffusion Profile** | Checks to make sure that your HDRP Asset references a [**Diffusion Profile**](Diffusion-Profile.md) Asset.<br />Press the **Fix** button to reload the runtime resources for the HDRP Asset. |
| **Default Volume Profile** | Checks to make sure you have assigned a **Default Volume Profile Asset** in **Edit** > **Project Settings** > **HDRP Default Settings** .<br />Press the **Fix** button to open a pop-up that allows you to either assign a Profile or create and assign a new one. |

Expand Down Expand Up @@ -97,5 +97,6 @@ When upgrading a project from the built-in render pipeline to HDRP, you need to

- **Upgrade Project Materials to High Definition Materials**: Upgrades every Material in your Unity Project to HDRP Materials.
- **Upgrade Selected Materials to High Definition Materials**: Upgrades every Material currently selected to HDRP Materials.
- **Upgrade HDRP Materials to Latest Version:** Upgrades every Material in your Unity Project to the latest version.

The lighting will not match as HDRP use a different attenuation function than built-in and use correct math to handle lighting model. There is no function that can convert the look. Thus the lighting will require to be redone.
17 changes: 14 additions & 3 deletions com.unity.render-pipelines.high-definition/Editor/USS/Wizard.uss
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,30 @@ ToolbarRadio
margin-right: 130px;
}

#Repopulate
.RightAnchoredButton
{
position: absolute;
right: 0px;
width: 120px;
width: 114px;
margin-top: 0px;
margin-right: 10px;
}

#LargeButton
.LargeButton
{
margin-left: 20px;
margin-right: 20px;
}

#HDRPVersionContainer
{
flex-direction: row;
margin-top: 10px;
padding-top: 3px;
padding-bottom: 3px;
padding-left: 3px;
}


/* spacing between categories */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ void FixDXRActivation(bool fromAsyncUnused)

#endregion

#region Packman
#region Package Manager

const string k_HdrpPackageName = "com.unity.render-pipelines.high-definition";
const string k_HdrpConfigPackageName = "com.unity.render-pipelines.high-definition-config";
Expand Down Expand Up @@ -821,8 +821,7 @@ void InstallLocalConfigurationPackage(Action onCompletion)

void RefreshDisplayOfConfigPackageArea()
{
if (!m_UsedPackageRetriever.isRunning)
IsLocalConfigurationPackageInstalledAsync(present => UpdateDisplayOfConfigPackageArea(present ? ConfigPackageState.Present : ConfigPackageState.Missing));
IsLocalConfigurationPackageInstalledAsync(present => UpdateDisplayOfConfigPackageArea(present ? ConfigPackageState.Present : ConfigPackageState.Missing));
}

static void CopyFolder(string sourceFolder, string destFolder)
Expand Down Expand Up @@ -915,72 +914,7 @@ void Finished()
}
}
UsedPackageRetriever m_UsedPackageRetriever = new UsedPackageRetriever();

class LastAvailablePackageVersionRetriever
{
PackageManager.Requests.SearchRequest m_CurrentRequest;
Action<string> m_CurrentAction;
string m_CurrentPackageName;

Queue<(string packageName, Action<string> action)> m_Queue = new Queue<(string packageName, Action<string> action)>();

bool isCurrentInProgress => m_CurrentRequest != null && !m_CurrentRequest.Equals(null) && !m_CurrentRequest.IsCompleted;

public bool isRunning => isCurrentInProgress || m_Queue.Count() > 0;

public void ProcessAsync(string packageName, Action<string> action)
{
if (isCurrentInProgress)
m_Queue.Enqueue((packageName, action));
else
Start(packageName, action);
}

void Start(string packageName, Action<string> action)
{
m_CurrentAction = action;
m_CurrentPackageName = packageName;
m_CurrentRequest = PackageManager.Client.Search(packageName, offlineMode: false);
EditorApplication.update += Progress;
}

void Progress()
{
//Can occures on Wizard close or if scripts reloads
if (m_CurrentRequest == null || m_CurrentRequest.Equals(null))
{
EditorApplication.update -= Progress;
return;
}

if (m_CurrentRequest.IsCompleted)
Finished();
}

void Finished()
{
EditorApplication.update -= Progress;
if (m_CurrentRequest.Status == PackageManager.StatusCode.Success)
{
string lastVersion = m_CurrentRequest.Result[0].versions.latestCompatible;
m_CurrentAction?.Invoke(lastVersion);
}
else if (m_CurrentRequest.Status >= PackageManager.StatusCode.Failure)
Debug.LogError($"Failed to find package {m_CurrentPackageName}. Reason: {m_CurrentRequest.Error.message}");
else
Debug.LogError("Unsupported progress state " + m_CurrentRequest.Status);

m_CurrentRequest = null;

if (m_Queue.Count > 0)
{
(string packageIdOrName, Action<string> action) = m_Queue.Dequeue();
EditorApplication.delayCall += () => Start(packageIdOrName, action);
}
}
}
LastAvailablePackageVersionRetriever m_LastAvailablePackageRetriever = new LastAvailablePackageVersionRetriever();


class PackageInstaller
{
PackageManager.Requests.AddRequest m_CurrentRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ static class Style
public const string migrateSelectedButton = "Upgrade Selected Materials to High Definition Materials";
public const string migrateMaterials = "Upgrade HDRP Materials to Latest Version";

public const string hdrpVersionLast = "You are using High-Definition Render Pipeline lastest {0} version."; //{0} will be replaced when displayed by the version number.
public const string hdrpVersionNotLast = "You are using High-Definition Render Pipeline {0} version. A new {1} version is available."; //{0} and {1} will be replaced when displayed by the version number.
public const string hdrpVersionWithLocalPackage = "You are using High-Definition Render Pipeline local {0} version. Last packaged version available is {1}."; //{0} and {1} will be replaced when displayed by the version number.
public const string hdrpVersionChecking = "Checking last version available for High-Definition Render Pipeline.";
public const string HDRPVersion = "Current HDRP version: ";
public const string HDRPVersionUpdateButton = "Check update";


//configuration debugger
public const string resolve = "Fix";
Expand Down Expand Up @@ -383,9 +382,9 @@ VisualElement CreateFolderData()
var repopulate = new Button(Repopulate)
{
text = Style.firstTimeInitLabel,
tooltip = Style.firstTimeInitTooltip,
name = "Repopulate"
tooltip = Style.firstTimeInitTooltip
};
repopulate.AddToClassList("RightAnchoredButton");

var row = new VisualElement() { name = "ResourceRow" };
row.Add(defaultResourceFolder);
Expand Down Expand Up @@ -431,11 +430,11 @@ VisualElement CreateWizardBehaviour()
}

VisualElement CreateLargeButton(string title, Action action)
=> new Button(action)
{
text = title,
name = "LargeButton"
};
Button button = new Button(action) { text = title };
button.AddToClassList("LargeButton");
return button;
}

VisualElement CreateInstallConfigPackageArea()
{
Expand Down Expand Up @@ -533,38 +532,24 @@ Label CreateTitle(string title)
return label;
}

HelpBox CreateHdrpVersionChecker()
VisualElement CreateHdrpVersionChecker()
{
var helpBox = new HelpBox(HelpBox.Kind.Info, Style.hdrpVersionChecking);
VisualElement container = new VisualElement() { name = "HDRPVersionContainer" };

m_LastAvailablePackageRetriever.ProcessAsync(k_HdrpPackageName, version =>
{
m_UsedPackageRetriever.ProcessAsync(k_HdrpPackageName, (installed, packageInfo) =>
{
// With recent introduction of preview srp version, our HDRP wizard don't work with Version() call
// patch it for now until this is solve.
bool compatibleWithVersionCall = version.ToString().Contains("preview") ? false : true;
TextElement label = new TextElement() { text = Style.HDRPVersion + "checking..." };
label.AddToClassList("normal");
container.Add(label);

// installed is not used because this one will be always installed
if (packageInfo.source == PackageManager.PackageSource.Local)
{
helpBox.kind = HelpBox.Kind.Info;
helpBox.text = String.Format(Style.hdrpVersionWithLocalPackage, packageInfo.version, version);
}
else if (compatibleWithVersionCall && (new Version(packageInfo.version) < new Version(version)))
{
helpBox.kind = HelpBox.Kind.Warning;
helpBox.text = String.Format(Style.hdrpVersionNotLast, packageInfo.version, version);
}
else if (compatibleWithVersionCall && (new Version(packageInfo.version) == new Version(version)))
{
helpBox.kind = HelpBox.Kind.Info;
helpBox.text = String.Format(Style.hdrpVersionLast, version);
}
});
});
Button button = new Button(() =>
UnityEditor.PackageManager.UI.Window.Open("com.unity.render-pipelines.high-definition"))
{ text = Style.HDRPVersionUpdateButton };
button.AddToClassList("RightAnchoredButton");
container.Add(button);

m_UsedPackageRetriever.ProcessAsync(k_HdrpPackageName, (installed, packageInfo)
=> label.text = Style.HDRPVersion + packageInfo.version + (packageInfo.source == PackageManager.PackageSource.Local ? " (local)" : ""));

return helpBox;
return container;
}

#endregion
Expand Down