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

Internal/master #8116

Merged
merged 52 commits into from
Dec 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3b58dd5
Fix shader warning
alelievr Nov 28, 2024
b457877
Graphics/SRP/RPF - [UUM-65578] Renabling non-RG testing for 275_RGBA1…
axoloto Nov 28, 2024
e3e1633
The Baked Lightmap debug doesnt work with HDRP terrains
SuminCho1 Nov 28, 2024
5afb27d
Graphics docs feedback fixes November 2024 (part 6)
markg-unity Nov 28, 2024
b1c8f27
docg-5368: Specify location of ambient occlusion properties
ocarrere Nov 28, 2024
b3bed68
Shadergraph support for spacewarp
lpledouxUnity Nov 29, 2024
1580968
[SRPF] GUIView update in the Building time could cause a failing SRP …
kirill-titov-u Nov 29, 2024
f23ea61
docg-5264: Update AxF-material-inspector-reference
ocarrere Nov 29, 2024
1a1b0aa
Graphics docs feedback fixes November 2024 (part 5)
markg-unity Nov 29, 2024
769e0e3
[HDRP] Reenable 3 graphics tests after stability fixes.
IonutNedelcuUnity Nov 29, 2024
104a37d
[Port] [Forward] [UUM-83862] Fix sorting the Reflection Probe by reso…
svc-reach-platform-support Nov 29, 2024
187a5f7
APV bug fixes
pmavridis Dec 2, 2024
a179332
Graphics docs feedback fixes November 2024 (part 8)
markg-unity Dec 2, 2024
2ffbc96
docg-4941: document Hair Master Stack Shader graph Fragments
ocarrere Dec 2, 2024
e2d3204
[VFX] Compilation Optimisation - Generate less DXR related code when …
ludovic-theobald Dec 3, 2024
8dd47cb
Fix color pyramid sampling UV when distortion is enabled
alelievr Dec 3, 2024
6a357fd
[6000.1][UUM-86922] Fix clear flags when post processing is used and …
kennytann Dec 3, 2024
71cf7fc
Fix for avoid warnings when using the NormalFromTexture node in Shade…
victor-riascos Dec 3, 2024
a7a887b
Variable shading rate init fix
eh-unity Dec 3, 2024
e9d5918
UUM75017 - Fix material changes impacting draw instances being ignore…
olivierprat Dec 3, 2024
a8bfe2a
Disable test for rendering layers on Switch
Adrian1066 Dec 4, 2024
4c0e650
HDRP Wizard FixAll button hide when no fix available
RSlysz Dec 4, 2024
338213e
[VFX/Docs] CustomHLSL & RWTexture
PaulDemeulenaere Dec 4, 2024
378382c
docg-5646 Fix typo
ocarrere Dec 5, 2024
3c9a145
[DocsQualityWeek2024] Improving documentation for VolumeComponents an…
ellioman Dec 5, 2024
4731ffb
Disable unstable test
ericksson Dec 5, 2024
f9e6d1e
[VFX] [Docs] Improved VFXTemplateDescriptor documentation
julienamsellem Dec 6, 2024
e0e96f7
docg-4944
ocarrere Dec 6, 2024
db4d1a5
[VFX] Enable instancing support for VFX using GPU events
gabrieldelacruz Dec 6, 2024
96d27ea
[VFX] Compilation Optimisation - Implement an include cache for SG ge…
ludovic-theobald Dec 6, 2024
c04ab13
[ShaderGraph] Prevent issues from multi-target property conflicts
Dec 6, 2024
ebd3a5f
Add vector4 as default into a sub-graph on converting from a node
Dec 6, 2024
42ef1da
Bicubic lightmap sampling for URP and HDRP
pema99 Dec 6, 2024
d18dd70
6.1 URP Deferred+
Dec 6, 2024
2ea3893
[VFX] [Doc] Added an example for VisualEffect.SetFloat
julienamsellem Dec 7, 2024
94e446f
[HDRP] Adding cave scene in water samples
remi-chapelain Dec 7, 2024
309bdc0
Render Graph - Add CullContext with Culling APIs
YohannVaastUnity Dec 7, 2024
283d125
Variable Rate Shading Custom Pass support for HDRP.
eh-unity Dec 9, 2024
8f6db0e
Graphics/foundation/update render api
RSlysz Dec 9, 2024
63448a9
[content automatically redacted] touching PlatformDependent folder
Dec 10, 2024
1e2cd0d
URP samples - Fix wrong GameObject names
YohannVaastUnity Dec 10, 2024
7128a4d
[HDRP] Disable 2 unstable graphics tests from HDRP_DXR project.
IonutNedelcuUnity Dec 11, 2024
dff9fab
Docsweek - Improve RenderingLayerMask enum docs and related API
laylaarab Dec 11, 2024
4e1a424
Graphics docs feedback fixes November 2024 (part 9 - VFX Graph fixes)
markg-unity Dec 12, 2024
d683d53
[Docs]Improving API docs for Debug Manager classes.
alex-vazquez-unity3d Dec 12, 2024
5cf397c
[URP] Added Support to Toggle Reflection Probe Atlas for Forward+
jrs-unity Dec 13, 2024
054e65b
DOCG-6165 Add horizontal deformation to HDRP water docs
markg-unity Dec 14, 2024
1072e93
[DocsQualityWeek2024] Updating UniversalAdditionalCameraData and Came…
ellioman Dec 16, 2024
dd1dd8b
DOCG-6335 Change references from Render (context, camera array) to Re…
markg-unity Dec 17, 2024
4d17614
Update ReloadAttribute documentation and linked documentation
RSlysz Dec 18, 2024
f990d81
DOCG-6338 Remove GPU Event experimental message and limitation
markg-unity Dec 18, 2024
7356826
Fix invalid area name
MindWrapper Dec 18, 2024
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
Prev Previous commit
Next Next commit
Update ReloadAttribute documentation and linked documentation
Update Documentation for ReloadAttribute and linked ReloadGroupAttribute and ResourceReloader in RPCore package.
RSlysz authored and Evergreen committed Dec 18, 2024
commit 4d1761490e6a66929c25f7c5a4d8f5206758580a
Original file line number Diff line number Diff line change
@@ -3,11 +3,52 @@
namespace UnityEngine.Rendering
{
/// <summary>
/// Attribute specifying information to reload with <see cref="ResourceReloader"/>. This is only
/// used in the editor and doesn't have any effect at runtime.
/// The <see cref="ReloadAttribute"/> attribute specifies paths for loading or reloading resources and has no direct action.
/// Used with the <see cref="ResourceReloader"/> to define where to load data for null fields.
/// </summary>
/// <remarks>
/// This attribute is designed for use in the Unity Editor and has no effect at runtime.
///
/// <see cref="IRenderPipelineResources"/> have their own attribute <see cref="ResourcePathAttribute"/> to do this.
/// When using them, resource reloading is handled automatically by the engine and does not require calling ResourceReloader.
///
/// While ResourceReloader was originally created for handling Scriptable Render Pipeline (SRP) resources, it has been replaced by <see cref="IRenderPipelineResources"/>.
/// The <see cref="ResourceReloader"/>, <see cref="ResourceReloader"/> and <see cref="ReloadGroupAttribute"/> remain available for for user-defined assets.
/// </remarks>
/// <seealso cref="ResourceReloader"/>
/// <seealso cref="ReloadGroupAttribute"/>
/// <example>
/// <para> This shows how to use the attribute in the expected scenario. This is particularly useful for content creators.
/// Adding a new field to a class that defines an asset results in null values for existing instances missing the field in their serialized data. Therefore, when a new field is added, a system for reloading null values may be necessary. </para>
/// <code>
///using UnityEngine;
///using UnityEditor;
///
///public class MyResourcesAsset : ScriptableObject
///{
/// [Reload("Shaders/Blit.shader")]
/// public Shader blit;
///
/// // Added in version 2
/// [Reload("Shaders/betterBlit.shader")]
/// public Shader betterBlit;
///}
///
///public static class MyResourceHandler
///{
/// public static MyResourcesAsset GetAndReload()
/// {
/// var resources = AssetDatabase.LoadAssetAtPath&lt;MyResourcesAsset&gt;("MyResources.asset");
///
/// // Ensure that update of the data layout of MyResourcesAsset
/// // will not result in null value for asset already existing.
/// // (e.g.: added betterBlit in the case above)
/// ResourceReloader.ReloadAllNullIn(resources, "Packages/com.my-custom-package/");
/// return resources;
/// }
///}
/// </code>
/// </example>
[AttributeUsage(AttributeTargets.Field)]
public sealed class ReloadAttribute : Attribute
{
@@ -52,6 +93,23 @@ public enum Package
/// </summary>
/// <param name="paths">Search paths</param>
/// <param name="package">The lookup method</param>
/// <example>
/// <para> This example demonstrates how to handle arrays with different resource paths. </para>
/// <code>
///using UnityEngine;
///
///public class MyResourcesAsset : ScriptableObject
///{
/// [ResourcePaths(new[]
/// {
/// "Texture/FilmGrain/Thin.png",
/// "Texture/FilmGrain/Medium.png",
/// "Texture/FilmGrain/Large.png",
/// })]
/// public Texture[] filmGrains;
///}
/// </code>
/// </example>
public ReloadAttribute(string[] paths, Package package = Package.Root)
{
#if UNITY_EDITOR
@@ -65,6 +123,18 @@ public ReloadAttribute(string[] paths, Package package = Package.Root)
/// </summary>
/// <param name="path">Search path</param>
/// <param name="package">The lookup method</param>
/// <example>
/// <para> This example shows how to directly specify the path of an asset. </para>
/// <code>
///using UnityEngine;
///
///public class MyResourcesAsset : ScriptableObject
///{
/// [Reload("Shaders/Blit.shader")]
/// public Shader blit;
///}
/// </code>
/// </example>
public ReloadAttribute(string path, Package package = Package.Root)
: this(new[] { path }, package)
{ }
@@ -77,6 +147,22 @@ public ReloadAttribute(string path, Package package = Package.Root)
/// <param name="rangeMin">The array start index (inclusive)</param>
/// <param name="rangeMax">The array end index (exclusive)</param>
/// <param name="package">The lookup method</param>
/// <example>
/// <para> This example demonstrates handling arrays with resource paths that share a common format, differing only by an index. </para>
/// <code>
///using UnityEngine;
///
///public class MyResourcesAsset : ScriptableObject
///{
/// // The following will seek for resources:
/// // - Texture/FilmGrain/Thin1.png
/// // - Texture/FilmGrain/Thin2.png
/// // - Texture/FilmGrain/Thin3.png
/// [ResourcePaths("Texture/FilmGrain/Thin{0}.png", 1, 4)]
/// public Texture[] thinGrains;
///}
/// </code>
/// </example>
public ReloadAttribute(string pathFormat, int rangeMin, int rangeMax,
Package package = Package.Root)
{
Original file line number Diff line number Diff line change
@@ -1,14 +1,57 @@
using System;
using UnityEditor;
using static UnityEngine.Rendering.DebugUI.Table;

namespace UnityEngine.Rendering
{
/// <summary>
/// Attribute specifying that it contains element that should be reloaded.
/// If the instance of the class is null, the system will try to recreate
/// it with the default constructor.
/// Be sure classes using it have default constructor!
/// Attribute specifying that fields of this type should be inspected in depth by the <see cref="ResourceReloader"/>.
/// If the associated class instance is null, the system attempts to recreate it using its default constructor.
/// </summary>
/// <remarks>
/// Make sure classes using it have a default constructor!
/// </remarks>
/// <seealso cref="ResourceReloader"/>
/// <seealso cref="ReloadAttribute"/>
/// <example>
/// <para> This shows how to use the attribute in the expected scenario. This is particularly useful for content creators.
/// Adding a new field to a class that defines an asset results in null values for existing instances missing the field in their serialized data. Therefore, when a new field is added, a system for reloading null values may be necessary. </para>
/// <code>
///using UnityEngine;
///using UnityEditor;
///
///[ReloadGroup]
///public class MyShaders
///{
/// [Reload("Shaders/Blit.shader")]
/// public Shader blit;
///}
///
///public class MyResourcesAsset : ScriptableObject
///{
/// // Object used for contextualizing would resolve to be null in already existing
/// // instance of MyResourcesAsset that already exists.
/// public MyShaders shaders;
///
/// [Reload("Textures/BayerMatrix.png")]
/// public Texture2D bayerMatrixTex;
///}
///
///public static class MyResourceHandler
///{
/// public static MyResourcesAsset GetAndReload()
/// {
/// var resources = AssetDatabase.LoadAssetAtPath&lt;MyResourcesAsset&gt;("MyResources.asset");
///
/// // Ensure that update of the data layout of MyResourcesAsset
/// // will not result in null value for asset already existing.
/// // (e.g.: adding new field in MyResourcesAsset or MyShaders classes)
/// ResourceReloader.ReloadAllNullIn(resources, "Packages/com.my-custom-package/");
/// return resources;
/// }
///}
/// </code>
/// </example>
[AttributeUsage(AttributeTargets.Class)]
public sealed class ReloadGroupAttribute : Attribute
{ }
Original file line number Diff line number Diff line change
@@ -15,12 +15,14 @@ namespace UnityEngine.Rendering
/// The reload call should only be done in Editor context though but it
/// could be called from runtime entities.
/// </summary>
/// <seealso cref="ReloadAttribute"/>
/// <seealso cref="ReloadGroupAttribute"/>
public static class ResourceReloader
{
/// <summary>
/// Looks for resources in the given <paramref name="container"/> object and reload the ones
/// that are missing or broken.
/// This version will still return null value without throwing error if the issue is due to
/// that are missing or broken, using the <see cref="ReloadAttribute"/> to find the paths.
/// This version returns a null value without throwing an error if the issue is
/// AssetDatabase being not ready. But in this case the assetDatabaseNotReady result will be true.
/// </summary>
/// <param name="container">The object containing reload-able resources</param>
@@ -47,7 +49,8 @@ public static (bool hasChange, bool assetDatabaseNotReady) TryReloadAllNullIn(Sy

/// <summary>
/// Looks for resources in the given <paramref name="container"/> object and reload the ones
/// that are missing or broken.
/// that are missing or broken, using the <see cref="ReloadAttribute"/> to find the paths.
/// See <see cref="ReloadAttribute"/> for an example.
/// </summary>
/// <param name="container">The object containing reload-able resources</param>
/// <param name="basePath">The base path for the package</param>