Skip to content

Commit da6f76e

Browse files
committed
Merge of #2253
commit e5e780c Author: Elvar Örn Unnþórsson <[email protected]> Date: Fri Oct 16 10:53:25 2020 +0200 Hide warnings about mismatched particle normals We always include vertex normals by default when building particle data, so users can switch between lit + unlit shaders without any extra config changes. This causes the standard particle gui to complain, but we should hide this error.
1 parent 795dfbd commit da6f76e

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

com.unity.render-pipelines.universal/CHANGELOG.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [11.0.0] - 2020-10-21
88

9-
Version Updated
10-
The version number for this package has increased due to a version update of a related graphics package.
11-
129
### Fixed
1310
- Fixed an issue where soft particles were not rendered when depth texture was disabled in the URP Asset. [case 1162556](https://issuetracker.unity3d.com/issues/lwrp-unlit-particles-shader-is-not-rendered-when-soft-particles-are-enabled-on-built-application)
1411
- Fixed an issue where soft particles were rendered opaque on OpenGL. [case 1226288](https://issuetracker.unity3d.com/issues/urp-objects-that-are-using-soft-particles-are-rendered-opaque-when-opengl-is-used)
1512
- Fixed an issue where the depth texture sample node used an incorrect texture in some frames. [case 1268079](https://issuetracker.unity3d.com/issues/urp-depth-texture-sample-node-does-not-use-correct-texture-in-some-frames)
13+
- Removed the warning about mis-matched vertex streams when creating a default Particle System. [case 1285272](https://issuetracker.unity3d.com/issues/particles-urp-default-material-shows-warning-in-inspector)
1614

1715
## [10.2.0] - 2020-10-19
1816

com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,9 @@ public static void DoVertexStreamsArea(Material material, List<ParticleSystemRen
327327

328328
bool streamsValid;
329329
if (useGPUInstancing && renderer.renderMode == ParticleSystemRenderMode.Mesh && renderer.supportsMeshInstancing)
330-
streamsValid = rendererStreams.SequenceEqual(instancedStreams);
330+
streamsValid = CompareVertexStreams(rendererStreams, instancedStreams);
331331
else
332-
streamsValid = rendererStreams.SequenceEqual(streams);
332+
streamsValid = CompareVertexStreams(rendererStreams, instancedStreams);
333333

334334
if (!streamsValid)
335335
Warnings += "-" + renderer.name + "\n";
@@ -356,6 +356,22 @@ public static void DoVertexStreamsArea(Material material, List<ParticleSystemRen
356356
}
357357
}
358358

359+
private static bool CompareVertexStreams(IEnumerable<ParticleSystemVertexStream> a, IEnumerable<ParticleSystemVertexStream> b)
360+
{
361+
var differenceA = a.Except(b);
362+
var differenceB = b.Except(a);
363+
var difference = differenceA.Union(differenceB).Distinct();
364+
if (!difference.Any())
365+
return true;
366+
// If normals are the only difference, ignore them, because the default particle streams include normals, to make it easy for users to switch between lit and unlit
367+
if (difference.Count() == 1)
368+
{
369+
if (difference.First() == ParticleSystemVertexStream.Normal)
370+
return true;
371+
}
372+
return false;
373+
}
374+
359375
public static void SetMaterialKeywords(Material material)
360376
{
361377
// Setup particle + material color blending

0 commit comments

Comments
 (0)