Skip to content

Commit 720cfc2

Browse files
authored
Merge pull request #1 from yl-msft/yl/update_MR_plugin1.4
Update to Unity 2020.3.35f1 and MR openxr plugin1.4.1
2 parents 61944a4 + 2c06747 commit 720cfc2

24 files changed

+1517
-287
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ver: 1
1+
ver: 2

SampleQRCodes/Assets/MRTK/Shaders/MixedRealityStandard.shader

+16-18
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ Shader "Mixed Reality Toolkit/Standard"
184184
#pragma shader_feature _ENVIRONMENT_COLORING
185185
#pragma shader_feature _IGNORE_Z_SCALE
186186

187-
#define IF(a, b, c) lerp(b, c, step((fixed) (a), 0.0));
188-
189187
#include "UnityCG.cginc"
190188
#include "UnityUI.cginc"
191189
#include "UnityStandardConfig.cginc"
@@ -279,7 +277,7 @@ Shader "Mixed Reality Toolkit/Standard"
279277
UNITY_VERTEX_INPUT_INSTANCE_ID
280278
};
281279

282-
struct v2f
280+
struct v2f
283281
{
284282
float4 position : SV_POSITION;
285283
#if defined(_BORDER_LIGHT)
@@ -456,7 +454,7 @@ Shader "Mixed Reality Toolkit/Standard"
456454

457455
#if defined(_ROUND_CORNERS)
458456
#if defined(_INDEPENDENT_CORNERS)
459-
float4 _RoundCornersRadius;
457+
float4 _RoundCornersRadius;
460458
#else
461459
fixed _RoundCornerRadius;
462460
#endif
@@ -473,7 +471,7 @@ Shader "Mixed Reality Toolkit/Standard"
473471
#endif
474472

475473
#if defined(_ROUND_CORNERS) || defined(_BORDER_LIGHT)
476-
fixed _EdgeSmoothingValue;
474+
float _EdgeSmoothingValue;
477475
#endif
478476

479477
#if defined(_INNER_GLOW)
@@ -530,7 +528,7 @@ Shader "Mixed Reality Toolkit/Standard"
530528
{
531529
float proximityLightDistance = dot(proximityLight.xyz - worldPosition, worldNormal);
532530
#if defined(_PROXIMITY_LIGHT_TWO_SIDED)
533-
worldNormal = IF(proximityLightDistance < 0.0, -worldNormal, worldNormal);
531+
worldNormal = proximityLightDistance < 0.0 ? -worldNormal : worldNormal;
534532
proximityLightDistance = abs(proximityLightDistance);
535533
#endif
536534
float normalizedProximityLightDistance = saturate(proximityLightDistance * proximityLightParams.y);
@@ -556,12 +554,12 @@ Shader "Mixed Reality Toolkit/Standard"
556554
return length(max(abs(position) - cornerCircleDistance, 0.0)) - cornerCircleRadius;
557555
}
558556

559-
inline fixed RoundCornersSmooth(float2 position, float2 cornerCircleDistance, float cornerCircleRadius)
557+
inline float RoundCornersSmooth(float2 position, float2 cornerCircleDistance, float cornerCircleRadius)
560558
{
561559
return smoothstep(1.0, 0.0, PointVsRoundedBox(position, cornerCircleDistance, cornerCircleRadius) / _EdgeSmoothingValue);
562560
}
563561

564-
inline fixed RoundCorners(float2 position, float2 cornerCircleDistance, float cornerCircleRadius)
562+
inline float RoundCorners(float2 position, float2 cornerCircleDistance, float cornerCircleRadius)
565563
{
566564
#if defined(_TRANSPARENT)
567565
return RoundCornersSmooth(position, cornerCircleDistance, cornerCircleRadius);
@@ -668,7 +666,7 @@ Shader "Mixed Reality Toolkit/Standard"
668666

669667
#if defined(_BORDER_LIGHT) || defined(_ROUND_CORNERS)
670668
o.uv.xy = TRANSFORM_TEX(v.uv, _MainTex);
671-
669+
672670
float minScale = min(min(o.scale.x, o.scale.y), o.scale.z);
673671

674672
#if defined(_BORDER_LIGHT)
@@ -723,8 +721,8 @@ Shader "Mixed Reality Toolkit/Standard"
723721

724722
#if defined(_BORDER_LIGHT)
725723
float scaleRatio = min(o.scale.x, o.scale.y) / max(o.scale.x, o.scale.y);
726-
o.uv.z = IF(o.scale.x > o.scale.y, 1.0 - (borderWidth * scaleRatio), 1.0 - borderWidth);
727-
o.uv.w = IF(o.scale.x > o.scale.y, 1.0 - borderWidth, 1.0 - (borderWidth * scaleRatio));
724+
o.uv.z = o.scale.x > o.scale.y ? 1.0 - (borderWidth * scaleRatio) : 1.0 - borderWidth;
725+
o.uv.w = o.scale.x > o.scale.y ? 1.0 - borderWidth : 1.0 - (borderWidth * scaleRatio);
728726
#endif
729727
#elif defined(_UV)
730728
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
@@ -798,8 +796,8 @@ Shader "Mixed Reality Toolkit/Standard"
798796
fixed4 albedo = fixed4(1.0, 1.0, 1.0, 1.0);
799797
#else
800798
#if defined(_TRIPLANAR_MAPPING)
801-
fixed4 albedo = tex2D(_MainTex, uvX) * triplanarBlend.x +
802-
tex2D(_MainTex, uvY) * triplanarBlend.y +
799+
fixed4 albedo = tex2D(_MainTex, uvX) * triplanarBlend.x +
800+
tex2D(_MainTex, uvY) * triplanarBlend.y +
803801
tex2D(_MainTex, uvZ) * triplanarBlend.z;
804802
#else
805803
#if defined(_USE_SSAA)
@@ -860,7 +858,7 @@ Shader "Mixed Reality Toolkit/Standard"
860858
#endif
861859
#if defined(_CLIPPING_BORDER)
862860
fixed3 primitiveBorderColor = lerp(_ClippingBorderColor, fixed3(0.0, 0.0, 0.0), primitiveDistance / _ClippingBorderWidth);
863-
albedo.rgb += primitiveBorderColor * IF((primitiveDistance < _ClippingBorderWidth), 1.0, 0.0);
861+
albedo.rgb += primitiveBorderColor * (primitiveDistance < _ClippingBorderWidth ? 1.0 : 0.0);
864862
#endif
865863
#endif
866864

@@ -1013,13 +1011,13 @@ Shader "Mixed Reality Toolkit/Standard"
10131011
#if defined(_BORDER_LIGHT)
10141012
fixed borderValue;
10151013
#if defined(_ROUND_CORNERS)
1016-
fixed borderMargin = _RoundCornerMargin + _BorderWidth * 0.5;
1014+
fixed borderMargin = _RoundCornerMargin + _BorderWidth * 0.5;
10171015

10181016
cornerCircleRadius = saturate(max(currentCornerRadius - borderMargin, 0.01)) * i.scale.z;
10191017

10201018
cornerCircleDistance = halfScale - (borderMargin * i.scale.z) - cornerCircleRadius;
10211019

1022-
borderValue = 1.0 - RoundCornersSmooth(roundCornerPosition, cornerCircleDistance, cornerCircleRadius);
1020+
borderValue = 1.0 - RoundCornersSmooth(roundCornerPosition, cornerCircleDistance, cornerCircleRadius);
10231021
#else
10241022
borderValue = max(smoothstep(i.uv.z - _EdgeSmoothingValue, i.uv.z + _EdgeSmoothingValue, distanceToEdge.x),
10251023
smoothstep(i.uv.w - _EdgeSmoothingValue, i.uv.w + _EdgeSmoothingValue, distanceToEdge.y));
@@ -1152,7 +1150,7 @@ Shader "Mixed Reality Toolkit/Standard"
11521150
// Environment coloring.
11531151
#if defined(_ENVIRONMENT_COLORING)
11541152
fixed3 environmentColor = incident.x * incident.x * _EnvironmentColorX +
1155-
incident.y * incident.y * _EnvironmentColorY +
1153+
incident.y * incident.y * _EnvironmentColorY +
11561154
incident.z * incident.z * _EnvironmentColorZ;
11571155
output.rgb += environmentColor * max(0.0, dot(incident, worldNormal) + _EnvironmentColorThreshold) * _EnvironmentColorIntensity;
11581156

@@ -1255,7 +1253,7 @@ Shader "Mixed Reality Toolkit/Standard"
12551253
ENDCG
12561254
}
12571255
}
1258-
1256+
12591257
Fallback "Hidden/InternalErrorShader"
12601258
CustomEditor "Microsoft.MixedReality.Toolkit.Editor.MixedRealityStandardShaderGUI"
12611259
}

SampleQRCodes/Assets/MixedRealityToolkit.Generated/ProjectPreferences.asset

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ MonoBehaviour:
2222
intPreferences:
2323
keys:
2424
- MixedRealityToolkit_Editor_AudioSpatializerCount
25-
values: 01000000
25+
- _MixedRealityToolkit_Editor_ConfiguratorState
26+
values: 01000000f4010000
2627
floatPreferences:
2728
keys: []
2829
values: []
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<linker>
1+
<linker>
22
<!--
33
This link.xml file is provided to prevent MRTK code from being optimized away
44
during IL2CPP builds.More details on when this is needed and why this is needed
@@ -8,28 +8,29 @@
88
below (in the previous example, we would remove the TeleportSystem below).
99
It's recommended to start with this list and narrow down if you want to ensure
1010
specific bits of code get optimized away.
11-
-->
12-
<assembly fullname = "Microsoft.MixedReality.Toolkit" preserve="all"/>
13-
<assembly fullname = "Microsoft.MixedReality.Toolkit.SDK" preserve="all"/>
14-
<!-- Core systems -->
15-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Services.BoundarySystem" preserve="all"/>
16-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Services.CameraSystem" preserve="all"/>
17-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Services.DiagnosticsSystem" preserve="all"/>
18-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Services.InputSystem" preserve="all"/>
19-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Services.SceneSystem" preserve="all"/>
20-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Services.SpatialAwarenessSystem" preserve="all"/>
21-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Services.TeleportSystem" preserve="all"/>
22-
<!-- Data providers -->
23-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Providers.LeapMotion" preserve="all"/>
24-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Providers.OpenVR" preserve="all"/>
25-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Providers.UnityAR" preserve="all"/>
26-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Providers.WindowsMixedReality.Shared" preserve="all"/>
27-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Providers.WindowsMixedReality" preserve="all"/>
28-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Providers.XRSDK.WindowsMixedReality" preserve="all"/>
29-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Providers.WindowsVoiceInput" preserve="all"/>
30-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Providers.XRSDK" preserve="all"/>
31-
<!-- Extension services -->
32-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Extensions.HandPhysics" preserve="all"/>
33-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Extensions.Tracking" preserve="all"/>
34-
<assembly fullname = "Microsoft.MixedReality.Toolkit.Extensions.SceneTransitionService" preserve="all"/>
35-
</linker>
11+
-->
12+
<assembly fullname="Microsoft.MixedReality.Toolkit" preserve="all" ignoreIfMissing="1" />
13+
<assembly fullname="Microsoft.MixedReality.Toolkit.SDK" preserve="all" ignoreIfMissing="1" />
14+
<!-- Core systems -->
15+
<assembly fullname="Microsoft.MixedReality.Toolkit.Services.BoundarySystem" preserve="all" ignoreIfMissing="1" />
16+
<assembly fullname="Microsoft.MixedReality.Toolkit.Services.CameraSystem" preserve="all" ignoreIfMissing="1" />
17+
<assembly fullname="Microsoft.MixedReality.Toolkit.Services.DiagnosticsSystem" preserve="all" ignoreIfMissing="1" />
18+
<assembly fullname="Microsoft.MixedReality.Toolkit.Services.InputSystem" preserve="all" ignoreIfMissing="1" />
19+
<assembly fullname="Microsoft.MixedReality.Toolkit.Services.SceneSystem" preserve="all" ignoreIfMissing="1" />
20+
<assembly fullname="Microsoft.MixedReality.Toolkit.Services.SpatialAwarenessSystem" preserve="all" ignoreIfMissing="1" />
21+
<assembly fullname="Microsoft.MixedReality.Toolkit.Services.TeleportSystem" preserve="all" ignoreIfMissing="1" />
22+
<!-- Data providers -->
23+
<assembly fullname="Microsoft.MixedReality.Toolkit.Providers.LeapMotion" preserve="all" ignoreIfMissing="1" />
24+
<assembly fullname="Microsoft.MixedReality.Toolkit.Providers.OpenVR" preserve="all" ignoreIfMissing="1" />
25+
<assembly fullname="Microsoft.MixedReality.Toolkit.Providers.OpenXR" preserve="all" ignoreIfMissing="1" />
26+
<assembly fullname="Microsoft.MixedReality.Toolkit.Providers.UnityAR" preserve="all" ignoreIfMissing="1" />
27+
<assembly fullname="Microsoft.MixedReality.Toolkit.Providers.WindowsMixedReality.Shared" preserve="all" ignoreIfMissing="1" />
28+
<assembly fullname="Microsoft.MixedReality.Toolkit.Providers.WindowsMixedReality" preserve="all" ignoreIfMissing="1" />
29+
<assembly fullname="Microsoft.MixedReality.Toolkit.Providers.XRSDK.WindowsMixedReality" preserve="all" ignoreIfMissing="1" />
30+
<assembly fullname="Microsoft.MixedReality.Toolkit.Providers.WindowsVoiceInput" preserve="all" ignoreIfMissing="1" />
31+
<assembly fullname="Microsoft.MixedReality.Toolkit.Providers.XRSDK" preserve="all" ignoreIfMissing="1" />
32+
<!-- Extension services -->
33+
<assembly fullname="Microsoft.MixedReality.Toolkit.Extensions.HandPhysics" preserve="all" ignoreIfMissing="1" />
34+
<assembly fullname="Microsoft.MixedReality.Toolkit.Extensions.Tracking" preserve="all" ignoreIfMissing="1" />
35+
<assembly fullname="Microsoft.MixedReality.Toolkit.Extensions.SceneTransitionService" preserve="all" ignoreIfMissing="1" />
36+
</linker>

0 commit comments

Comments
 (0)