Skip to content

Commit

Permalink
Merge pull request #7968 from Unity-Technologies/internal/2023.1/staging
Browse files Browse the repository at this point in the history
Internal/2023.1/staging
  • Loading branch information
UnityAljosha authored Oct 9, 2023
2 parents 07791b8 + ee2b0f0 commit 2c80a82
Show file tree
Hide file tree
Showing 93 changed files with 28,738 additions and 251 deletions.
16 changes: 16 additions & 0 deletions Packages/com.unity.render-pipelines.core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ 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.

## [15.0.6] - 2023-09-27

This version is compatible with Unity 2023.1.16f1.

### Added
- Added callbacks when RenderPipeline is created or disposed.
- ObjectID Render Request that provides a render texture with the ObjectId of each pixel.

### Fixed
- Fixed potentially broken rendering and errors after renaming a VolumeProfile asset.
- Fixed a crash on keywords::LocalKeywordState::ResetWithSpace when shader contains Grab Pass.
- Fixed Rendering Debugger runtime UI getting occluded by user UI with sorting order larger than 0.
- Removed some unexpected SRP changed callback invocations.
- Fixed console errors when debug actions are removed from Input Manager during play mode.
- Fixed occasional ArgumentOutOfRangeException in StaticLightingSky.

## [15.0.5] - 2023-05-23

This version is compatible with Unity 2023.1.0b19.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Collections.Generic;
using UnityEngine;

namespace UnityEditor.Rendering
{
/// <summary> Set of helpers for AssetDatabase operations. </summary>
public static class AssetDatabaseHelper
{
/// <summary>
/// Finds all assets of type T in the project.
/// </summary>
/// <param name="extension">Asset type extension i.e ".mat" for materials</param>
/// <typeparam name="T">The type of material you are looking for</typeparam>
/// <returns>A IEnumerable object</returns>
public static IEnumerable<T> FindAssets<T>(string extension = null)
{
string typeName = typeof(T).ToString();
int i = typeName.LastIndexOf('.');
if (i != -1)
{
typeName = typeName.Substring(i+1, typeName.Length - i-1);
}

string query = !string.IsNullOrEmpty(extension) ? $"t:{typeName} glob:\"**/*{extension}\"" : $"t:{typeName}";

foreach (var guid in AssetDatabase.FindAssets(query))
{
var asset = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(guid));
if (asset is T castAsset)
yield return castAsset;
}
}
}
}

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

74 changes: 40 additions & 34 deletions Packages/com.unity.render-pipelines.core/Editor/MaterialUpgrader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public class MaterialUpgrader
string m_OldShader;
string m_NewShader;

private static string[] s_PathsWhiteList = new[]
{
"Hidden/",
"HDRP/",
"Shader Graphs/"
};

/// <summary>
/// Retrieves path to new shader.
/// </summary>
Expand Down Expand Up @@ -309,20 +316,6 @@ public void RenameKeywordToFloat(string oldName, string newName, float setVal, f
m_KeywordFloatRename.Add(new KeywordFloatRename { keyword = oldName, property = newName, setVal = setVal, unsetVal = unsetVal });
}

/// <summary>
/// Checking if the passed in value is a path to a Material.
/// </summary>
/// <param name="path">Path to test.</param>
/// <returns>Returns true if the passed in value is a path to a material.</returns>
static bool IsMaterialPath(string path)
{
if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException(nameof(path));
}
return path.HasExtension(".mat");
}

static MaterialUpgrader GetUpgrader(List<MaterialUpgrader> upgraders, Material material)
{
if (material == null || material.shader == null)
Expand Down Expand Up @@ -364,6 +357,29 @@ static bool ShouldUpgradeShader(Material material, HashSet<string> shaderNamesTo
return !shaderNamesToIgnore.Contains(material.shader.name);
}


private static bool IsNotAutomaticallyUpgradable(List<MaterialUpgrader> upgraders, Material material)
{
return GetUpgrader(upgraders, material) == null && !material.shader.name.ContainsAny(s_PathsWhiteList);
}


/// <summary>
/// Checking if project folder contains any materials that are not using built-in shaders.
/// </summary>
/// <param name="upgraders">List if MaterialUpgraders</param>
/// <returns>Returns true if at least one material uses a non-built-in shader (ignores Hidden, HDRP and Shader Graph Shaders)</returns>
public static bool ProjectFolderContainsNonBuiltinMaterials(List<MaterialUpgrader> upgraders)
{
foreach (var material in AssetDatabaseHelper.FindAssets<Material>(".mat"))
{
if(IsNotAutomaticallyUpgradable(upgraders, material))
return true;
}

return false;
}

/// <summary>
/// Upgrade the project folder.
/// </summary>
Expand All @@ -388,31 +404,21 @@ public static void UpgradeProjectFolder(List<MaterialUpgrader> upgraders, HashSe
if ((!Application.isBatchMode) && (!EditorUtility.DisplayDialog(DialogText.title, "The upgrade will overwrite materials in your project. " + DialogText.projectBackMessage, DialogText.proceed, DialogText.cancel)))
return;

int totalMaterialCount = 0;
foreach (string s in UnityEditor.AssetDatabase.GetAllAssetPaths())
{
if (IsMaterialPath(s))
totalMaterialCount++;
}

var materialAssets = AssetDatabase.FindAssets($"t:{nameof(Material)} glob:\"**/*.mat\"");
int materialIndex = 0;
foreach (string path in UnityEditor.AssetDatabase.GetAllAssetPaths())
{
if (IsMaterialPath(path))
{
materialIndex++;
if (UnityEditor.EditorUtility.DisplayCancelableProgressBar(progressBarName, string.Format("({0} of {1}) {2}", materialIndex, totalMaterialCount, path), (float)materialIndex / (float)totalMaterialCount))
break;

Material m = UnityEditor.AssetDatabase.LoadMainAssetAtPath(path) as Material;
foreach (var guid in materialAssets)
{
Material material = AssetDatabase.LoadAssetAtPath<Material>(AssetDatabase.GUIDToAssetPath(guid));
materialIndex++;
if (UnityEditor.EditorUtility.DisplayCancelableProgressBar(progressBarName, string.Format("({0} of {1}) {2}", materialIndex, materialAssets.Length, material), (float)materialIndex / (float)materialAssets.Length))
break;

if (!ShouldUpgradeShader(m, shaderNamesToIgnore))
continue;
if (!ShouldUpgradeShader(material, shaderNamesToIgnore))
continue;

Upgrade(m, upgraders, flags);
Upgrade(material, upgraders, flags);

//SaveAssetsAndFreeMemory();
}
}

// Upgrade terrain specifically since it is a builtin material
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,29 @@ public static class StringExtensions
/// <returns>True if the extension is found on the string path</returns>
public static bool HasExtension(this string input, string extension) =>
input.EndsWith(extension, StringComparison.OrdinalIgnoreCase);


/// <summary>
/// Checks if a string contains any of the strings given in strings to check and early out if it does
/// </summary>
/// <param name="input">The input string</param>
/// <param name="stringsToCheck">List of strings to check</param>
/// <returns>True if a string contains any of the strings given in strings </returns>
public static bool ContainsAny(this string input, params string[] stringsToCheck)
{
if(string.IsNullOrEmpty(input))
return false;

foreach (var value in stringsToCheck)
{
if(string.IsNullOrEmpty(value))
continue;

if (input.Contains(value))
return true;
}

return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1875,6 +1875,20 @@ public override object Clone()
{
return new AnimationCurveParameter(new AnimationCurve(GetValue<AnimationCurve>().keys), overrideState);
}

/// <summary>
/// Returns a hash code for the animationCurve.
/// </summary>
/// <returns>A hash code for the animationCurve.</returns>
public override int GetHashCode()
{
unchecked
{
var hash = overrideState.GetHashCode();

return hash * 23 + value.GetHashCode();
}
}
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Packages/com.unity.render-pipelines.core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.unity.render-pipelines.core",
"description": "SRP Core makes it easier to create or customize a Scriptable Render Pipeline (SRP). SRP Core contains reusable code, including boilerplate code for working with platform-specific graphics APIs, utility functions for common rendering operations, and shader libraries. The code in SRP Core is use by the High Definition Render Pipeline (HDRP) and Universal Render Pipeline (URP). If you are creating a custom SRP from scratch or customizing a prebuilt SRP, using SRP Core will save you time.",
"version": "15.0.6",
"version": "15.0.7",
"unity": "2023.1",
"displayName": "Core RP Library",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ 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.

## [15.0.6] - 2023-09-27

This version is compatible with Unity 2023.1.16f1.

Version Updated
The version number for this package has increased due to a version update of a related graphics package.

## [15.0.5] - 2023-05-23

This version is compatible with Unity 2023.1.0b19.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "com.unity.render-pipelines.high-definition-config",
"description": "Configuration files for the High Definition Render Pipeline.",
"version": "15.0.6",
"version": "15.0.7",
"unity": "2023.1",
"displayName": "High Definition RP Config",
"dependencies": {
"com.unity.render-pipelines.core": "15.0.6"
"com.unity.render-pipelines.core": "15.0.7"
}
}
74 changes: 74 additions & 0 deletions Packages/com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,80 @@ 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.

## [15.0.6] - 2023-09-27

This version is compatible with Unity 2023.1.16f1.

### Changed
- Improved CPU performances by disabling "QuantizedFrontToBack" sorting in opaque rendering.
- When HDRP is disabled, Compute Shaders are being stripped.
- Avoid clamping to integers for HDR manipulation.
- Reduced GC Alloc when using raytracing and HDRP.
- Updated description of Decal Projector Draw Distance setting to mention HDRP asset setting.

### Fixed
- Fixed TAA aliasing edge issues on alpha output for recorder / green screen. This fix does the following:
* Removes history rejection when the current alpha value is 0. Instead it does blend with the history color when alpha value is 0 on the current plane.
* The reasoning for blending again with the history when alpha is 0 is because we want the color to blend a bit with opacity, which is the main reason for the alpha values. sort of like a precomputed color
* As a safety, we set the color to black if alpha is 0. This results in better image quality when alpha is enabled.
- Added check to ensure gismos arent rendered when they shouldnt be.
- Fixed quad overdraw debug at high resolution.
- Fixed cloud layer rotation does not allow for smooth rotation.
- Fixed GetScaledSize when not using scaling.
- Fixed VT init to avoid RTHandle allocation outside of HDRP rendering loop.
- Upgrading from DLSS 2.4 to DLSS 3.0 for upscaling part.
- Fixed the incorrect base color of decals for transparency.
- Fixed shaders stripping for Lens Flares.
- Various space transform fixes.
- Fixed HDProbes to support custom resolutions for all rendering modes.
- Fixed scene template dependencies.
- Minor fix to HDRP UI when Raytraced AO is enabled.
- Added a new custom pass injection after opaque and sky finished rendering.
- Fixed D3D validation error for area lights in HDShadowAtlas.
- Fixed baked light being wrongly put in the cached shadow atlas.
- Improving DLSS ghosting artifacts a little bit, by using a better pre-exposure parameter. Fixing reset history issues on DLSS camera cuts.
- Added an helpbox for local custom pass volumes that doesn't have a collider attached.
- Respect the transparent reflections settings when using raytracing.
- Fixed Virtual offset being computed if distance was 0.
- Show base color texture on decal materials if Affect BaseColor is disabled.
- Fixed inconsistent documentation about hardware supporting raytracing.
- Fixed wrong metapass when using planar/triplanar projection in HDRP.
- Fixed color pyramid history buffer logic when history is reset and the color pyramid is not required.
- Fixed fireflies in path traced volume scattering using MIS. Add support for anisotropic fog.
- Fixed Decal additive normal blending on shadergraph materials.
- Fixed decal projector with neutral normal when using surface gradient.
- Fixed recovering the current Quality level when migrating a HDRP Asset.
- Added warning to reflection probe editor to prevent user from baking in a low quality level.
- Fixed custom pass injection point "After Opaque And Sky" happening after cloud rendering.
- Fixed FTLP (Fine Tiled Light Pruning) Shader Options max light count. Previous support only supported up to 63 These changes allow to go up to 255 with higher instability as numbers per tile approach 255.
For support greater than 255, do it at your own risk! (and expect some flickering).
- Fixed out of bounds access when XR is enabled.
- Mixed runtime lights were not considering the intensity multiplier during bakes. These changes fix this behaviour and make bakes more intuitive.
- Fixed the incorrect size of the material preview texture.
- Fixed prefab preview rendering dark until moved.
- Fixed: realtime Reflection probe makes volumetrics clouds wind stop.
- Fixed error on water inspector when no SRP is active.
- Fixed preview for refractive materials with MSAA.
- Allow the game to switch HDR on or off during run time.
- Fixed GraphicsBuffer leak from APV binding code.
- Re-enabled HDR output on Mac (Was disabled).
- Fixed a potential GPU crash/hang when using local volumetric fogs.
- Added error when the Rendering Layer names in HDRP Global Settings is empty.
- Fixed an issue where an async pass would try to sync to a culled pass mistakenly.
- Fixed the logic used to set up materials featuring displacement mapping that would sometimes result in artifacts or suboptimal performance.
- Mixed tracing mode for transparent screenspace reflections now mixes both tracing modes as expected, instead of only using ray traced reflections.
- Fixed custom post process volume component example in doc.
- Fixed ShaderGraph Decal material position issue by using world space position.
- Fixed the sharpening pass in order to avoid washed-out colors when using a render target with an alpha channel.
- Fixed Helpbox UI for LightProbeGroup Inspector.
- Fixed missing current sector data in debug modes.
- Fixed error when assigning non water material to water.
- Fixed to sample settings helper.
- Fixed foam generated on shore waves.
- Fixed missing foam color parameter.
- Fixed GPU warnings due to water system.
- Fixing a DLSS error in the Standalone Profiler console for Unity 2023.1 by backporting a PR that recently fixed it in 2023.2

## [15.0.5] - 2023-05-23

This version is compatible with Unity 2023.1.0b19.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ protected override bool showSection
if (materials[0].IsShaderGraph())
{
var shader = materials[0].shader;
var defaultRefractionModel = shader.GetPropertyDefaultFloatValue(shader.FindPropertyIndex(kRefractionModel));

var propertyIndex = shader.FindPropertyIndex(kRefractionModel);
if (propertyIndex == -1)
return false;

var defaultRefractionModel = shader.GetPropertyDefaultFloatValue(propertyIndex);
if (defaultRefractionModel == 0)
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public class Styles
public const string cacheErrorFormat = "This configuration will lead to more than 2 GB reserved for this cache at runtime! ({0} requested) Only {1} element will be reserved instead.";
public const string cacheInfoFormat = "Reserving {0} in memory at runtime.";
public const string multipleDifferenteValueMessage = "Multiple different values";
public const string rayTracingUnsupportedMessage = "The current HDRP Asset does not support Ray Tracing.";

public static readonly GUIContent cookieSizeContent = EditorGUIUtility.TrTextContent("Cookie Size", "Specifies the maximum size for the individual 2D cookies that HDRP uses for Directional and Spot Lights.");
public static readonly GUIContent cookieTextureArraySizeContent = EditorGUIUtility.TrTextContent("Texture Array Size", "Sets the maximum Texture Array size for the 2D cookies HDRP uses for Directional and Spot Lights. Higher values allow HDRP to use more cookies concurrently on screen.");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;

namespace UnityEditor.Rendering.HighDefinition
{
[CanEditMultipleObjects]
[CustomEditor(typeof(LightCluster))]
class LightClusterEditor : VolumeComponentEditor
{
public override void OnInspectorGUI()
{
HDRenderPipelineAsset currentAsset = HDRenderPipeline.currentAsset;
bool notSupported = currentAsset != null && !currentAsset.currentPlatformRenderPipelineSettings.supportRayTracing;
if (notSupported)
{
EditorGUILayout.Space();
HDEditorUtils.QualitySettingsHelpBox(HDRenderPipelineUI.Styles.rayTracingUnsupportedMessage,
MessageType.Warning, HDRenderPipelineUI.ExpandableGroup.Rendering,
"m_RenderPipelineSettings.supportRayTracing");
}
using var disableScope = new EditorGUI.DisabledScope(notSupported);

base.OnInspectorGUI();
}
}
}
Loading

0 comments on commit 2c80a82

Please sign in to comment.