Skip to content

Commit 595f518

Browse files
committed
Updates to version .86
* New features * Switch to the MagicLeap OpenXR plugin. This removes usage of the deprecated MLSDK unity plugin. * Add MagicLeap Spectator support. This component, available under `Settings > Advanced`, allows users to view the Leap Brush scene from a separate phone for high quality mixed reality capture. See https://www.magicleap.care/hc/en-us/articles/22350469887117-Magic-Leap-Spectator-User-Guide * Update various packages and dependencies * Update Unity Editor to LTS 2022.3.33f1 * Update MRTK3 to v3.2.0 * Update com.magicleap.mrtk3 to 1.1.0 * Update com.magicleap.soundfield to 3.4.6-240418.125575.a7b4d14 * Update com.magicleap.spectator to 1.3.4 * Update com.magicleap.unitysdk to 2.3.0 * Update com.unity.ide.rider to 3.0.31 * Update com.unity.textmeshpro to 3.2.0-pre.10 * Update com.unity.toolchain.macos-x86_64-linux-x86_64 to 2.0.9 * Update com.unity.xr.arfoundation to 5.1.5 * Update com.unity.xr.openxr to 1.11.0 * Added segmented dimming to most UI content. Hand visuals remain un-dimmed to avoid distraction. * Uses the OpenXR PreMultipliedAlpha layer flag to allow for pure additive content. * Improve dimmer shader and simplify -- now uses stock shaders with a separate dimmer override pass * Improve MagicLeap capture visuals by properly setting alpha values. * Reduce app load time from 12 to 6 seconds: Disable the Unity splash screen and move the keyboard scene to be on-demand * Clean up Anchor management to use lastest unitysdk recommendations, integration with ARAnchorManager, etc * Bug fixes * Preload shaders, enable graphics jobs, and spread out glb file loading to improve performance and reduce stuttering. * Allow controller to draw strokes even if out of view: limit the out of view checks to hand input only. * Fix a race condition around joining a remote user and hiding their Headset visuals * Fix the position of the Controller instructions to properly align * Fix an issue where brush strokes could move to origin if tracking is lost while drawing commit sha 60c22f3182916261f8dd322ed58f64ec103bb547
1 parent 020bb45 commit 595f518

File tree

453 files changed

+28215
-51658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

453 files changed

+28215
-51658
lines changed

LeapBrush/Assets/MRTK.Generated/MRTKSettings.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ MonoBehaviour:
1717
- key: 1
1818
value: {fileID: 11400000, guid: c677e5c4eb85b7849a8da406775c299d, type: 2}
1919
- key: 7
20-
value: {fileID: 11400000, guid: 46eb174601bc4384f8481fe881e8da53, type: 2}
20+
value: {fileID: 11400000, guid: a4d48fb8885c8bd4e9dd5c57fba1824e, type: 2}
2121
buildPreferences:
2222
appLauncherModel: {fileID: 0}
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using UnityEditor;
4+
using UnityEngine;
5+
6+
namespace MagicLeap.LeapBrush
7+
{
8+
[CustomEditor(typeof(ShaderWarming))]
9+
public class ShaderWarmingEditor : Editor
10+
{
11+
private string shaderLogString = "";
12+
13+
public override void OnInspectorGUI()
14+
{
15+
DrawDefaultInspector();
16+
ShaderWarming shaderWarming = (ShaderWarming) target;
17+
18+
EditorGUILayout.HelpBox(
19+
"Log lines are output when ShaderWarming has the [Capture Used Shaders] " +
20+
"option turned on. Copy the log lines that include \"UsedNotWarmed\" and/or " +
21+
"\"WarmedNotUsed\" into the following text area and press the button below to " +
22+
"update the collection.",
23+
MessageType.Info);
24+
GUILayout.Label("Shader Log Strings (One Per Line):");
25+
shaderLogString = GUILayout.TextArea(shaderLogString);
26+
27+
if (GUILayout.Button("Update Prewarms from Shader Log Strings"))
28+
{
29+
string[] lines = shaderLogString.Trim().Split("\n");
30+
foreach (string line in lines)
31+
{
32+
string[] pieces = line.Trim().Split(";");
33+
if (pieces.Length != 4)
34+
{
35+
Debug.LogError($"Invalid format for shader log string: {line}");
36+
return;
37+
}
38+
39+
bool wasUsed = pieces[0].EndsWith("UsedNotWarmed");
40+
if (!wasUsed && !pieces[0].EndsWith("WarmedNotUsed"))
41+
{
42+
Debug.LogError("Invalid format for shader log string, expected to find " +
43+
$"\"UsedNotWarmed\" or \"WarmedNotUsed\" present: {line}");
44+
return;
45+
}
46+
47+
string shaderName = pieces[1];
48+
49+
List<string> keywords = new();
50+
if (pieces[2].Length > 0)
51+
{
52+
keywords = pieces[2].Split(",").ToList();
53+
keywords.Sort();
54+
}
55+
56+
List<ShaderWarming.VertexAttributeDescriptorSerializable> vertexAttributes =
57+
new();
58+
if (pieces[3].Length > 0)
59+
{
60+
foreach (string vertexAttributeStr in pieces[3].Split(","))
61+
{
62+
vertexAttributes.Add(
63+
ShaderWarming.VertexAttributeDescriptorSerializable.FromString(
64+
vertexAttributeStr));
65+
}
66+
}
67+
68+
Shader shader = Shader.Find(shaderName);
69+
if (shader == null)
70+
{
71+
Debug.LogError($"Shader {shaderName} not found");
72+
return;
73+
}
74+
75+
ShaderWarming.ShaderWarmingInfo matchedInfo = null;
76+
foreach (ShaderWarming.ShaderWarmingInfo info in shaderWarming
77+
.ShaderWarmingInfos)
78+
{
79+
if (info.shader != shader)
80+
{
81+
continue;
82+
}
83+
84+
if (info.keywords.Count != keywords.Count)
85+
{
86+
continue;
87+
}
88+
89+
bool keywordsMatch = true;
90+
for (int i = 0; i < info.keywords.Count; i++)
91+
{
92+
if (info.keywords[i] != keywords[i])
93+
{
94+
keywordsMatch = false;
95+
}
96+
}
97+
98+
if (!keywordsMatch)
99+
{
100+
continue;
101+
}
102+
103+
if (info.vertexDescriptors.Count != vertexAttributes.Count)
104+
{
105+
continue;
106+
}
107+
108+
bool vertexAttributesMatch = true;
109+
for (int i = 0; i < info.vertexDescriptors.Count; i++)
110+
{
111+
if (!info.vertexDescriptors[i].Equals(vertexAttributes[i]))
112+
{
113+
vertexAttributesMatch = false;
114+
}
115+
}
116+
117+
if (!vertexAttributesMatch)
118+
{
119+
continue;
120+
}
121+
122+
matchedInfo = info;
123+
break;
124+
}
125+
126+
if (wasUsed && matchedInfo == null)
127+
{
128+
matchedInfo = new ShaderWarming.ShaderWarmingInfo
129+
{
130+
shader = shader,
131+
keywords = keywords,
132+
vertexDescriptors = vertexAttributes
133+
};
134+
shaderWarming.ShaderWarmingInfos.Add(matchedInfo);
135+
}
136+
137+
if (!wasUsed && matchedInfo != null)
138+
{
139+
shaderWarming.ShaderWarmingInfos.Remove(matchedInfo);
140+
}
141+
}
142+
143+
shaderLogString = "";
144+
145+
EditorUtility.SetDirty(shaderWarming);
146+
}
147+
}
148+
}
149+
}

LeapBrush/Assets/MagicLeap/LeapBrush/Editor/ShaderWarmingEditor.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LeapBrush/Assets/MagicLeap/LeapBrush/Input/LeapBrushInput.inputactions

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,19 @@
99
"name": "Toggle Menu",
1010
"type": "Button",
1111
"id": "e0b7131d-4e6b-45a5-94fe-adea98c8bf4b",
12-
"expectedControlType": "Button",
12+
"expectedControlType": "",
1313
"processors": "",
1414
"interactions": "",
1515
"initialStateCheck": false
16+
},
17+
{
18+
"name": "ControllerTrackpad",
19+
"type": "Value",
20+
"id": "e66682a7-ea1d-4c75-84b1-aded5267d6b7",
21+
"expectedControlType": "Vector2",
22+
"processors": "",
23+
"interactions": "",
24+
"initialStateCheck": true
1625
}
1726
],
1827
"bindings": [
@@ -48,6 +57,39 @@
4857
"action": "Toggle Menu",
4958
"isComposite": false,
5059
"isPartOfComposite": false
60+
},
61+
{
62+
"name": "",
63+
"id": "be3381ee-0e54-4ff0-a671-8c08a43a4615",
64+
"path": "<XRController>{LeftHand}/menuButton",
65+
"interactions": "",
66+
"processors": "",
67+
"groups": "",
68+
"action": "Toggle Menu",
69+
"isComposite": false,
70+
"isPartOfComposite": false
71+
},
72+
{
73+
"name": "",
74+
"id": "95e98f49-27e1-41ee-a947-ef543dd35d4d",
75+
"path": "<MagicLeapController>{RightHand}/trackpad",
76+
"interactions": "",
77+
"processors": "",
78+
"groups": "",
79+
"action": "ControllerTrackpad",
80+
"isComposite": false,
81+
"isPartOfComposite": false
82+
},
83+
{
84+
"name": "",
85+
"id": "10ece7ce-8b5a-4d6c-8e96-c025d198cf5c",
86+
"path": "<MagicLeapController>{LeftHand}/trackpad",
87+
"interactions": "",
88+
"processors": "",
89+
"groups": "",
90+
"action": "ControllerTrackpad",
91+
"isComposite": false,
92+
"isPartOfComposite": false
5193
}
5294
]
5395
}

LeapBrush/Assets/MagicLeap/LeapBrush/Materials/Dimmer.mat renamed to LeapBrush/Assets/MagicLeap/LeapBrush/Materials/DimmerAlpha.mat

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,24 @@ Material:
77
m_CorrespondingSourceObject: {fileID: 0}
88
m_PrefabInstance: {fileID: 0}
99
m_PrefabAsset: {fileID: 0}
10-
m_Name: Dimmer
11-
m_Shader: {fileID: 4800000, guid: 650dd9526735d5b46b79224bc6e94025, type: 3}
10+
m_Name: DimmerAlpha
11+
m_Shader: {fileID: 4800000, guid: 109e1aab8c2f549d3855a94bf8a1885c, type: 3}
1212
m_Parent: {fileID: 0}
1313
m_ModifiedSerializedProperties: 0
1414
m_ValidKeywords: []
15-
m_InvalidKeywords:
16-
- _EMISSION
17-
m_LightmapFlags: 0
15+
m_InvalidKeywords: []
16+
m_LightmapFlags: 4
1817
m_EnableInstancingVariants: 0
19-
m_DoubleSidedGI: 1
20-
m_CustomRenderQueue: 2000
21-
stringTagMap:
22-
RenderType: Opaque
18+
m_DoubleSidedGI: 0
19+
m_CustomRenderQueue: 4000
20+
stringTagMap: {}
2321
disabledShaderPasses: []
2422
m_LockedProperties:
2523
m_SavedProperties:
2624
serializedVersion: 3
2725
m_TexEnvs:
2826
- _BaseMap:
29-
m_Texture: {fileID: 0}
27+
m_Texture: {fileID: 2800000, guid: 02b41135652424687a583bd15f3acd28, type: 3}
3028
m_Scale: {x: 1, y: 1}
3129
m_Offset: {x: 0, y: 0}
3230
- _BumpMap:
@@ -49,10 +47,6 @@ Material:
4947
m_Texture: {fileID: 0}
5048
m_Scale: {x: 1, y: 1}
5149
m_Offset: {x: 0, y: 0}
52-
- _Illum:
53-
m_Texture: {fileID: 0}
54-
m_Scale: {x: 1, y: 1}
55-
m_Offset: {x: 0, y: 0}
5650
- _MainTex:
5751
m_Texture: {fileID: 0}
5852
m_Scale: {x: 1, y: 1}
@@ -69,65 +63,64 @@ Material:
6963
m_Texture: {fileID: 0}
7064
m_Scale: {x: 1, y: 1}
7165
m_Offset: {x: 0, y: 0}
72-
- _Tex:
66+
- _SpecGlossMap:
67+
m_Texture: {fileID: 0}
68+
m_Scale: {x: 1, y: 1}
69+
m_Offset: {x: 0, y: 0}
70+
- unity_Lightmaps:
71+
m_Texture: {fileID: 0}
72+
m_Scale: {x: 1, y: 1}
73+
m_Offset: {x: 0, y: 0}
74+
- unity_LightmapsInd:
7375
m_Texture: {fileID: 0}
7476
m_Scale: {x: 1, y: 1}
7577
m_Offset: {x: 0, y: 0}
76-
- _Texture:
78+
- unity_ShadowMasks:
7779
m_Texture: {fileID: 0}
7880
m_Scale: {x: 1, y: 1}
7981
m_Offset: {x: 0, y: 0}
8082
m_Ints: []
8183
m_Floats:
84+
- _Alpha: 0
8285
- _AlphaClip: 0
8386
- _AlphaToMask: 0
8487
- _Blend: 0
88+
- _BlendModePreserveSpecular: 1
8589
- _BlendOp: 0
8690
- _BumpScale: 1
87-
- _Cull: 0
91+
- _ClearCoatMask: 0
92+
- _ClearCoatSmoothness: 0
93+
- _Cull: 2
8894
- _Cutoff: 0.5
95+
- _DetailAlbedoMapScale: 1
8996
- _DetailNormalMapScale: 1
9097
- _DstBlend: 0
9198
- _DstBlendAlpha: 0
92-
- _Emission: 1
93-
- _Exposure: 1
94-
- _FresnelBias: 0
95-
- _FresnelPower: 1.09
96-
- _FresnelScale: 1
97-
- _GlossMapScale: 1
98-
- _Glossiness: 0.5
99-
- _GlossyReflections: 1
100-
- _Inside: 0.397
101-
- _InvFade: 1.81
99+
- _EnvironmentReflections: 0
100+
- _GlossMapScale: 0
101+
- _Glossiness: 0
102+
- _GlossyReflections: 0
102103
- _Metallic: 0
103-
- _Mode: 0
104104
- _OcclusionStrength: 1
105-
- _Parallax: 0.02
105+
- _Parallax: 0.005
106106
- _QueueOffset: 0
107-
- _Rim: 0.499
108-
- _Rotation: 0
107+
- _ReceiveShadows: 0
109108
- _SampleGI: 0
110-
- _Shininess: 0.7
109+
- _Smoothness: 0.5
111110
- _SmoothnessTextureChannel: 0
112-
- _SpecularHighlights: 1
113-
- _Speed: 0.5
111+
- _SpecularHighlights: 0
114112
- _SrcBlend: 1
115113
- _SrcBlendAlpha: 1
116-
- _Strength: 1.5
117114
- _Surface: 0
118-
- _Tile: 5
119-
- _UVSec: 0
115+
- _WorkflowMode: 1
120116
- _ZWrite: 1
121117
m_Colors:
122118
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
123119
- _Color: {r: 1, g: 1, b: 1, a: 1}
124-
- _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
125-
- _FresnelColor: {r: 1, g: 1, b: 1, a: 1}
126-
- _SpecColor: {r: 1, g: 1, b: 1, a: 1}
127-
- _Tint: {r: 1, g: 1, b: 1, a: 1}
128-
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
120+
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
121+
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
129122
m_BuildTextureStacks: []
130-
--- !u!114 &3264011209724917906
123+
--- !u!114 &1356495905160393411
131124
MonoBehaviour:
132125
m_ObjectHideFlags: 11
133126
m_CorrespondingSourceObject: {fileID: 0}
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)