From be43339d27ac8c3a0d21f89b1a5b301d861b177f Mon Sep 17 00:00:00 2001 From: Unity Technologies <@unity> Date: Fri, 6 Sep 2024 00:00:00 +0000 Subject: [PATCH] com.unity.entities.graphics@1.3.2 ## [1.3.2] - 2024-09-06 ### Changed * Updated entities packages dependencies ### Fixed * Fixed an issue with entities.graphics and Burst 1.8.12 --- CHANGELOG.md | 11 +++++++++++ Documentation~/mesh_deformations.md | 16 +++++++++++++--- Unity.Entities.Graphics/DrawCommandGeneration.cs | 2 -- Unity.Entities.Graphics/RenderMeshUtility.cs | 4 ++-- ValidationExceptions.json | 10 +++++----- package.json | 10 +++++----- 6 files changed, 36 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c55e278..23dcb97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ uid: changelog # Changelog + +## [1.3.2] - 2024-09-06 + +### Changed +* Updated entities packages dependencies + +### Fixed + +* Fixed an issue with entities.graphics and Burst 1.8.12 + + ## [1.3.0-pre.4] - 2024-07-17 ### Fixed diff --git a/Documentation~/mesh_deformations.md b/Documentation~/mesh_deformations.md index 344ca8c..d558ca8 100644 --- a/Documentation~/mesh_deformations.md +++ b/Documentation~/mesh_deformations.md @@ -19,7 +19,7 @@ To use mesh deformations in your Unity Project: Before you can use mesh deformations in your Unity project, you must set up your Unity Project to support this feature. To do this: -1. Make sure your Unity Project uses the Entities Graphics package. For information on how to install packages, see the [Package Manager manual](https://docs.unity3d.com/Manual/upm-ui.html). +1. Make sure your Unity Project uses the Entities Graphics package. For information on how to install Entities Graphics, refer to [Create a new project with Entities Graphics](creating-a-new-entities-graphics-project.html#create-a-new-project-with-entities-graphics). 2. If you intend to use per-vertex motion vectors, go to Project Settings (menu: **Edit** > **Project Settings**) and, in the Player section, add `ENABLE_DOTS_DEFORMATION_MOTION_VECTORS` to **Scripting Define Symbols**. Unity currently only supports this when using the High Definition Render Pipeline. **Note**: To apply changes to the define, you must re-save any Shader Graphs. 3. Create a Skinned Mesh Renderer with compatible materials using the [Mesh setup](#mesh-setup) and [Material setup](#material-setup) steps. @@ -36,6 +36,7 @@ After you set up your project to support mesh deformations, you can create a mat 2. Add the [Compute Deformation](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest?subfolder=/manual/Compute-Deformation-Node.html) node to the Shader Graph. 3. Connect the position, normal, and tangent outputs of the node to the vertex position, normal, and tangent slots in the master node respectively. 4. Save the Shader Graph. +5. Create a new material and assign the Shader Graph as its shader. ### Mesh setup @@ -45,6 +46,15 @@ After you create a material that supports mesh deformations, you can set up a me 2. Make sure that the mesh has blendshapes and/or a valid bind pose and skin weights. If Unity doesn't detect the appropriate data, it displays an error in the Skinned Mesh Renderer component Inspector. 3. Assign the material you created in [Material setup](#material-setup) to all material slots on the Skinned Mesh Renderer. +Place the GameObject or Prefab in a subscene to deform the Entities using mesh deformations. + +### Deform meshes using a script + +After you've set up a scene that uses Mesh Deformations, you can use custom scripts to create movement in the deformed entities. To do this, you can use an ECS System. + +For example, in a [SystemBase](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.SystemBase.html), you can use a Query to find components that may exist in your scene, such as the [Skin Matrix](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Deformations.SkinMatrix.html) or [Blend Shape](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Deformations.BlendShapeWeight.html) ECS component. Then, your system can modify the values of these component's properties to result in movement over time. + +For an example, refer to the scenes `SampleScenes/5. Deformation/MeshDeformations` and `SampleScenes/5. Deformation/SkinnedCharacter` in the `Assets` folder of [URPSamples](https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/GraphicsSamples/URPSamples) and [HDRPSamples](https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/GraphicsSamples/HDRPSamples). ### Vertex shader skinning @@ -73,7 +83,8 @@ Vertex shader skinning skins the mesh on the GPU in the vertex shader. To enable | | **Skinned Mesh Renderer** | **Entities Graphics** | | ------------------------------------------------- | --------------------------| ----------------------| | Linear Blend Skinning | Supported | Supported | -| Blend Shapes | Supported | Supported | +| Blend Shapes | Supported | Supported | +| Blend Shape Frames | Supported | --- | | Per Vertex Motion Vectors | [Supported](xref:UnityEngine.SkinnedMeshRenderer.skinnedMotionVectors) | Only in HDRP (With define) | | Optional normals & tangents | Supported | --- | | Resizeable render bounds based on animated pose | [Supported](xref:UnityEngine.SkinnedMeshRenderer.updateWhenOffscreen) | --- | @@ -81,4 +92,3 @@ Vertex shader skinning skins the mesh on the GPU in the vertex shader. To enable | Cloth Simulation | Supported | --- | | Quality setting for limiting skin influences | Supported | --- | | CPU Deformations | [Supported](xref:UnityEditor.PlayerSettings.gpuSkinning) | --- | -| Blend Shape Frames | Supported | --- | \ No newline at end of file diff --git a/Unity.Entities.Graphics/DrawCommandGeneration.cs b/Unity.Entities.Graphics/DrawCommandGeneration.cs index 7dfcdb7..ccaa0c2 100644 --- a/Unity.Entities.Graphics/DrawCommandGeneration.cs +++ b/Unity.Entities.Graphics/DrawCommandGeneration.cs @@ -271,7 +271,6 @@ internal struct ChunkDrawCommand : IComparable } [BurstCompile] - [NoAlias] internal unsafe struct DrawStream where T : unmanaged { public const int kArraySizeElements = 16; @@ -374,7 +373,6 @@ internal unsafe struct Header // UnsafeUtility.Free(header, allocator); // } - [return: NoAlias] public T* AppendElement(RewindableAllocator* allocator) { if (m_Count >= ElementsPerArray) diff --git a/Unity.Entities.Graphics/RenderMeshUtility.cs b/Unity.Entities.Graphics/RenderMeshUtility.cs index fcb706e..dfbc91e 100644 --- a/Unity.Entities.Graphics/RenderMeshUtility.cs +++ b/Unity.Entities.Graphics/RenderMeshUtility.cs @@ -1,4 +1,4 @@ -#if HDRP_10_0_0_OR_NEWER +#if HDRP_10_0_0_OR_NEWER || URP_16_0_0_OR_NEWER #define USE_HYBRID_MOTION_PASS #endif @@ -205,7 +205,7 @@ internal static ComponentTypeSet ComputeComponentTypes(EntitiesGraphicsComponent internal static void AppendMotionAndProbeFlags(this ref EntitiesGraphicsComponentFlags flags, RenderMeshDescription renderMeshDescription, bool isStatic) { // Entities with Static are never rendered with motion vectors - if (k_UseHybridMotionPass && renderMeshDescription.FilterSettings.IsInMotionPass && !isStatic) + if (k_UseHybridMotionPass && renderMeshDescription.FilterSettings.IsInMotionPass && renderMeshDescription.FilterSettings.MotionMode == MotionVectorGenerationMode.Object && !isStatic) flags |= EntitiesGraphicsComponentFlags.InMotionPass; flags |= LightProbeFlags(renderMeshDescription.LightProbeUsage); } diff --git a/ValidationExceptions.json b/ValidationExceptions.json index 6149704..fbb429f 100644 --- a/ValidationExceptions.json +++ b/ValidationExceptions.json @@ -3,29 +3,29 @@ { "ValidationTest": "API Updater Configuration Validation", "ExceptionMessage": "stdout:\nAPIUpdater Configuration Validation\n-----------------------------------\n\nConfiguration Validation Tests (Failed: 0, Total: 1, Ignored 0):\n----------------------------------------------------------------\n\n\nAuto Generated Tests (Failed: 1, Total: 1, Ignored 0):\n------------------------------------------------------\n1) Expected updates not applied for configuration:\n[*] System.SByte [*] Unity.Rendering.MaterialMeshInfo::Submesh -> * Unity.Rendering.MaterialMeshInfo::SubMesh\n\nInput : unsafe class Test : object { System.SByte Method(System.SByte memberValue, Unity.Rendering.MaterialMeshInfo obj) { System.SByte local = obj.Submesh; return Method(obj.Submesh, obj); } }\nExpected: unsafe class Test : object { System.UInt16 Method(System.UInt16 memberValue, Unity.Rendering.MaterialMeshInfo obj) { System.UInt16 local = obj.SubMesh; return Method(obj.SubMesh, obj); } }\nActual : unsafe class Test : object { System.SByte Method(System.SByte memberValue, Unity.Rendering.MaterialMeshInfo obj) { System.SByte local = obj.SubMesh; return Method(obj.SubMesh, obj); } }\n\n\nBase type validation (Failed: 0, Total: 0, Ignored 0):\n------------------------------------------------------\nstderr:\n", - "PackageVersion": "1.3.0-pre.4" + "PackageVersion": "1.3.2" }, { "ValidationTest": "API Validation", "ExceptionMessage": "Breaking changes require a new major version.", - "PackageVersion": "1.3.0-pre.4" + "PackageVersion": "1.3.2" } ], "WarningExceptions": [ { "ValidationTest": "Manifest Validation", "ExceptionMessage": "Package dependency com.unity.entities@0.60.0-preview.88 must be promoted to production before this package is promoted to production. (Except for core packages)", - "PackageVersion": "1.3.0-pre.4" + "PackageVersion": "1.3.2" }, { "ValidationTest": "Folder Structure Validation", "ExceptionMessage": "The Resources Directory should not be used in packages. For more guidance, please visit https://docs.unity3d.com/Manual/BestPracticeUnderstandingPerformanceInUnity6.html", - "PackageVersion": "1.3.0-pre.4" + "PackageVersion": "1.3.2" }, { "ValidationTest": "Package Lifecycle Validation", "ExceptionMessage": "com.unity.entities.graphics has never been promoted to production before. Please contact Release Management through slack in #devs-pkg-promotion to promote the first version of your package before trying to use this automated pipeline. Read more about this error and potential solutions at https://docs.unity3d.com/Packages/com.unity.package-validation-suite@latest/index.html?preview=1&subfolder=/manual/lifecycle_validation_error.html#the-very-first-version-of-a-package-must-be-promoted-by-release-management", - "PackageVersion": "1.3.0-pre.4" + "PackageVersion": "1.3.2" } ] } diff --git a/package.json b/package.json index 4673190..9d20027 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "com.unity.entities.graphics", "displayName": "Entities Graphics", - "version": "1.3.0-pre.4", + "version": "1.3.2", "unity": "2022.3", "unityRelease": "11f1", "description": "The Entities Graphics package provides systems and components for drawing meshes using DOTS, including support for instanced mesh rendering and LOD.", "dependencies": { - "com.unity.entities": "1.3.0-pre.4", + "com.unity.entities": "1.3.2", "com.unity.modules.particlesystem": "1.0.0", "com.unity.render-pipelines.core": "14.0.9" }, @@ -17,15 +17,15 @@ "unity" ], "_upm": { - "changelog": "### Fixed\n\n* Pink materials when causing a domain reload while a subscene is open with lightmapped materials." + "changelog": "### Changed\n* Updated entities packages dependencies\n\n### Fixed\n\n* Fixed an issue with entities.graphics and Burst 1.8.12" }, "upmCi": { - "footprint": "a5e32d10578d6b283b267f5fef1d7ef03714e0b1" + "footprint": "b30d75e71b7cb1e38d98d187e7095ae1ea33bbce" }, "documentationUrl": "https://docs.unity3d.com/Packages/com.unity.entities.graphics@1.3/manual/index.html", "repository": { "url": "https://github.cds.internal.unity3d.com/unity/dots.git", "type": "git", - "revision": "6b0c8d27a0224c9cf76032c48d1b981e9750f10d" + "revision": "921920e681054c59b440cc1e2aef10f781dc4124" } }