Skip to content

Commit 7f764e0

Browse files
[11.x.x] Batch of PRs (#2390)
* Merge of #2283 commit 4168f84 Author: thomas-zeng <[email protected]> Date: Thu Oct 22 10:53:27 2020 -0700 Fixed typo. Updated CHANGELOG.md commit d9b0581 Merge: 53b2082 8bc58a4 Author: thomas-zeng <[email protected]> Date: Thu Oct 22 10:50:33 2020 -0700 Merge branch 'master' of https://github.com/Unity-Technologies/Graphics into universal/xr/fix-mirror-view-convention commit 53b2082 Author: thomas-zeng <[email protected]> Date: Mon Oct 19 16:47:33 2020 -0700 Fixed mirror view shader reading wrong viewport region from the eye textures. * 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. # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md * Merge of #2222 commit bfb132b Author: thomas-zeng <[email protected]> Date: Tue Oct 13 16:45:52 2020 -0700 Fixed camera matrix not restored after modification. * Merge of #2284 commit 502a242 Merge: 2c742d8 acaf95d Author: Nigel John Williams <[email protected]> Date: Thu Oct 22 13:30:58 2020 +0200 Merge branch 'master' into universal/sun-source-light-type commit 2c742d8 Merge: 00042cb 4acb87d Author: nigeljw-unity <[email protected]> Date: Tue Oct 20 11:52:38 2020 +0200 Merge branch 'master' into universal/sun-source-light-type commit 00042cb Author: nigeljw-unity <[email protected]> Date: Tue Oct 20 11:16:20 2020 +0200 Fix sun source warning text Changed sun source warning message to explicitly specify light window's environment settings. commit 489e90f Author: nigeljw-unity <[email protected]> Date: Tue Oct 20 11:00:56 2020 +0200 Fix code comment about sun light Corrected legacy code comment about sun light for selection of main light. commit 51e3147 Author: Nigel John Williams <[email protected]> Date: Fri Oct 16 16:50:03 2020 +0200 Restrict sun source to only directional lights and display warning message if user changes the sun light type. * Merge of #2135 commit 6633ec9 Author: thomas-zeng <[email protected]> Date: Tue Oct 20 16:30:22 2020 -0700 Updated CHANGELOG.md. commit 7078aa1 Merge: a706832 52ec802 Author: thomas-zeng <[email protected]> Date: Tue Oct 20 16:28:14 2020 -0700 Merge branch 'master' of https://github.com/Unity-Technologies/Graphics into universal/xr/clamp-msaa commit a706832 Author: thomas-zeng <[email protected]> Date: Thu Oct 8 10:34:38 2020 -0700 Added next power of 2 logic and clamp logic to XR msaa setter. * Added missing changelog for #2284 Co-authored-by: Nigel John Williams <[email protected]>
1 parent df74ad8 commit 7f764e0

File tree

7 files changed

+59
-12
lines changed

7 files changed

+59
-12
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +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.
9+
### Fixed
10+
- 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)
11+
- Fixed latest mockHMD renderviewport scale doesn't fill whole view after scaling. [case 1286161] (https://issuetracker.unity3d.com/issues/xr-urp-renderviewportscale-doesnt-fill-whole-view-after-scaling)
12+
- Fixed camera renders black in XR when user sets invalid MSAA value.
13+
- Fixed an issue causing additional lights to stop working when set as the sun source. [case 1278768](https://issuetracker.unity3d.com/issues/urp-every-light-type-is-rendered-as-directional-light-if-it-is-set-as-sun-source-of-the-environment)
1114

1215
## [10.2.0] - 2020-10-19
1316

@@ -18,6 +21,7 @@ The version number for this package has increased due to a version update of a r
1821
- Fixed the Unlit shader not being SRP Batcher compatible on OpenGLES/OpenGLCore. [case 1263720](https://issuetracker.unity3d.com/issues/urp-mobile-srp-batcher-is-not-visible-on-mobile-devices-in-frame-debugger)
1922
- Fixed an issue with soft particles not rendering correctly for overlay cameras with post processing. [case 1241626](https://issuetracker.unity3d.com/issues/soft-particles-does-not-fade-out-near-the-opaque-surfaces-when-post-processing-is-enabled-on-a-stacked-camera)
2023

24+
2125
## [10.1.0] - 2020-10-12
2226
### Added
2327
- Added support for the Shadowmask Mixed Lighting Mode (Forward only), which supports up to four baked-shadow Lights.

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

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

318318
bool streamsValid;
319319
if (useGPUInstancing && renderer.renderMode == ParticleSystemRenderMode.Mesh && renderer.supportsMeshInstancing)
320-
streamsValid = rendererStreams.SequenceEqual(instancedStreams);
320+
streamsValid = CompareVertexStreams(rendererStreams, instancedStreams);
321321
else
322-
streamsValid = rendererStreams.SequenceEqual(streams);
322+
streamsValid = CompareVertexStreams(rendererStreams, instancedStreams);
323323

324324
if (!streamsValid)
325325
Warnings += "-" + renderer.name + "\n";
@@ -346,6 +346,22 @@ public static void DoVertexStreamsArea(Material material, List<ParticleSystemRen
346346
}
347347
}
348348

349+
private static bool CompareVertexStreams(IEnumerable<ParticleSystemVertexStream> a, IEnumerable<ParticleSystemVertexStream> b)
350+
{
351+
var differenceA = a.Except(b);
352+
var differenceB = b.Except(a);
353+
var difference = differenceA.Union(differenceB).Distinct();
354+
if (!difference.Any())
355+
return true;
356+
// 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
357+
if (difference.Count() == 1)
358+
{
359+
if (difference.First() == ParticleSystemVertexStream.Normal)
360+
return true;
361+
}
362+
return false;
363+
}
364+
349365
public static void SetMaterialKeywords(Material material)
350366
{
351367
// Setup particle + material color blending

com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineLightEditor.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Styles
2525

2626
public readonly GUIContent BakingWarning = EditorGUIUtility.TrTextContent("Light mode is currently overridden to Realtime mode. Enable Baked Global Illumination to use Mixed or Baked light modes.");
2727
public readonly GUIContent DisabledLightWarning = EditorGUIUtility.TrTextContent("Lighting has been disabled in at least one Scene view. Any changes applied to lights in the Scene will not be updated in these views until Lighting has been enabled again.");
28+
public readonly GUIContent SunSourceWarning = EditorGUIUtility.TrTextContent("This light is set as the current Sun Source, which requires a directional light. Go to the Lighting Window's Environment settings to edit the Sun Source.");
2829

2930
public readonly GUIContent ShadowsNotSupportedWarning = EditorGUIUtility.TrTextContent("Realtime shadows for point lights are not supported. Either disable shadows or set the light mode to Baked.");
3031
public static readonly GUIContent ShadowRealtimeSettings = EditorGUIUtility.TrTextContent("Realtime Shadows", "Settings for realtime direct shadows.");
@@ -111,6 +112,12 @@ public override void OnInspectorGUI()
111112

112113
settings.DrawLightType();
113114

115+
Light light = target as Light;
116+
if (LightType.Directional != light.type && light == RenderSettings.sun)
117+
{
118+
EditorGUILayout.HelpBox(s_Styles.SunSourceWarning.text, MessageType.Warning);
119+
}
120+
114121
EditorGUILayout.Space();
115122

116123
// When we are switching between two light types that don't show the range (directional and area lights)
@@ -141,7 +148,6 @@ public override void OnInspectorGUI()
141148
using (var group = new EditorGUILayout.FadeGroupScope(1.0f - m_AnimAreaOptions.faded))
142149
if (group.visible)
143150
{
144-
Light light = target as Light;
145151
if (light.type != LightType.Disc)
146152
{
147153
settings.DrawLightmapping();

com.unity.render-pipelines.universal/Runtime/Passes/DrawSkyboxPass.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,19 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData
4545
context.ExecuteCommandBuffer(cmd);
4646

4747
CommandBufferPool.Release(cmd);
48+
49+
renderingData.cameraData.camera.ResetStereoProjectionMatrices();
50+
renderingData.cameraData.camera.ResetStereoViewMatrices();
4851
}
4952
else
5053
{
5154
renderingData.cameraData.camera.projectionMatrix = renderingData.cameraData.GetProjectionMatrix(0);
5255
renderingData.cameraData.camera.worldToCameraMatrix = renderingData.cameraData.GetViewMatrix(0);
5356

5457
context.DrawSkybox(renderingData.cameraData.camera);
58+
59+
renderingData.cameraData.camera.ResetProjectionMatrix();
60+
renderingData.cameraData.camera.ResetWorldToCameraMatrix();
5561
}
5662
}
5763
else

com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,14 +1017,18 @@ static int GetMainLightIndex(UniversalRenderPipelineAsset settings, NativeArray<
10171017
if (currLight == null)
10181018
break;
10191019

1020-
if (currLight == sunLight)
1021-
return i;
1022-
1023-
// In case no shadow light is present we will return the brightest directional light
1024-
if (currVisibleLight.lightType == LightType.Directional && currLight.intensity > brightestLightIntensity)
1020+
if (currVisibleLight.lightType == LightType.Directional)
10251021
{
1026-
brightestLightIntensity = currLight.intensity;
1027-
brightestDirectionalLightIndex = i;
1022+
// Sun source needs be a directional light
1023+
if (currLight == sunLight)
1024+
return i;
1025+
1026+
// In case no sun light is present we will return the brightest directional light
1027+
if (currLight.intensity > brightestLightIntensity)
1028+
{
1029+
brightestLightIntensity = currLight.intensity;
1030+
brightestDirectionalLightIndex = i;
1031+
}
10281032
}
10291033
}
10301034

com.unity.render-pipelines.universal/Runtime/XR/XRSystem.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ internal static void XRSystemInit()
8686

8787
internal static void UpdateMSAALevel(int level)
8888
{
89+
if (msaaLevel == level)
90+
return;
91+
92+
level = Mathf.NextPowerOfTwo(level);
93+
level = Mathf.Clamp(level, (int)MsaaQuality.Disabled, (int)MsaaQuality._8x);
94+
8995
GetDisplaySubsystem();
9096

9197
#if UNITY_2020_2_OR_NEWER

com.unity.render-pipelines.universal/Shaders/XR/XRMirrorView.hlsl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ Varyings VertQuad(Attributes input)
2828
Varyings output;
2929
output.positionCS = GetQuadVertexPosition(input.vertexID) * float4(_ScaleBiasRt.x, _ScaleBiasRt.y, 1, 1) + float4(_ScaleBiasRt.z, _ScaleBiasRt.w, 0, 0);
3030
output.positionCS.xy = output.positionCS.xy * float2(2.0f, -2.0f) + float2(-1.0f, 1.0f); //convert to -1..1
31+
32+
#if UNITY_UV_STARTS_AT_TOP
33+
// Unity viewport convention is bottom left as origin. Adjust Scalebias to read the correct region.
34+
_ScaleBias.w = 1 - _ScaleBias.w - _ScaleBias.y;
35+
#endif
3136
output.texcoord = GetQuadTexCoord(input.vertexID) * _ScaleBias.xy + _ScaleBias.zw;
3237
return output;
3338
}

0 commit comments

Comments
 (0)