Skip to content

Commit

Permalink
Version 0.3.2
Browse files Browse the repository at this point in the history
Updated glTFast package
  • Loading branch information
De-Panther committed Feb 6, 2021
1 parent 9d25128 commit 7536f8a
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 20 deletions.
Binary file modified Build/Build/Build.data.unityweb
Binary file not shown.
Binary file modified Build/Build/Build.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion Build/Build/Build.wasm.framework.unityweb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"dependencies": {
"com.atteneder.gltfast": "2.5.0",
"com.atteneder.gltfast": "3.0.1",
"com.unity.collab-proxy": "1.2.16",
"com.unity.ide.rider": "1.1.4",
"com.unity.ide.vscode": "1.2.3",
Expand Down
4 changes: 2 additions & 2 deletions Packages/packages-lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"com.atteneder.gltfast": {
"version": "2.5.0",
"version": "3.0.1",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -18,7 +18,7 @@
"source": "embedded",
"dependencies": {
"com.unity.nuget.newtonsoft-json": "2.0.0",
"com.atteneder.gltfast": "2.5.0"
"com.atteneder.gltfast": "3.0.1"
}
},
"com.unity.collab-proxy": {
Expand Down
4 changes: 4 additions & 0 deletions Packages/webxr-input-profiles-loader/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.2] - 2020-02-06
### Changed
- Updated glTFast package to 3.0.1.

## [0.3.1] - 2020-12-19
### Changed
- Increment version due to error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class InputProfileModel : MonoBehaviour

private GltfAsset gltfAsset;

public void Init(LayoutRouting layoutRouting, string url, System.Action<bool> callback = null)
public async void Init(LayoutRouting layoutRouting, string url, System.Action<bool> callback = null)
{
this.layoutRouting = layoutRouting;
onLoadCallback = callback;
Expand All @@ -25,15 +25,14 @@ public void Init(LayoutRouting layoutRouting, string url, System.Action<bool> ca
}
gltfAsset.loadOnStartup = false;
gltfAsset.url = url;
gltfAsset.onLoadComplete += OnGltfLoaded;
var deferAgent = gameObject.AddComponent<TimeBudgetDeferAgent>();
deferAgent.timeBudget = 0.001f;
gltfAsset.Load(gltfAsset.url, null, deferAgent);
var loadResult = await gltfAsset.Load(gltfAsset.url, null, deferAgent);
OnGltfLoaded(loadResult);
}

private void OnGltfLoaded(GltfAssetBase assetBase, bool success)
private void OnGltfLoaded(bool success)
{
gltfAsset.onLoadComplete -= OnGltfLoaded;
if (!success)
{
onLoadCallback?.Invoke(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using GLTFast;
using System.Threading.Tasks;
using UnityEngine;

namespace WebXRInputProfile
{
[DefaultExecutionOrder(-10)]
public class TimeBudgetDeferAgent : MonoBehaviour, IDeferAgent
{
public float timeBudget = 0.001f;
Expand All @@ -25,13 +27,33 @@ void Reset()

public bool ShouldDefer()
{
float now = Time.realtimeSinceStartup;
if (now - lastTime > timeBudget)
return !FitsInCurrentFrame(0);
}

public bool ShouldDefer(float duration)
{
return !FitsInCurrentFrame(duration);
}

bool FitsInCurrentFrame(float duration)
{
return duration <= timeBudget - (Time.realtimeSinceStartup - lastTime);
}

public async Task BreakPoint()
{
if (ShouldDefer())
{
await Task.Yield();
}
}

public async Task BreakPoint(float duration)
{
if (ShouldDefer(duration))
{
lastTime = now;
return true;
await Task.Yield();
}
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ ShaderVariantCollection:
- first: {fileID: 4800000, guid: 99fa998bbbed3408aafa652b466d261d, type: 3}
second:
variants:
- keywords: BILLBOARD_FACE_CAMERA_POS DIRECTIONAL LIGHTPROBE_SH SHADOWS_SCREEN
SHADOWS_SOFT SHADOWS_SPLIT_SPHERES SOFTPARTICLES_ON UNITY_HDR_ON _METALLICGLOSSMAP
- keywords: DIRECTIONAL LIGHTPROBE_SH SHADOWS_SCREEN _METALLICGLOSSMAP
passType: 4
- keywords: DIRECTIONAL LIGHTPROBE_SH SHADOWS_SCREEN _METALLICGLOSSMAP _NORMALMAP
_OCCLUSION
passType: 4
- keywords:
passType: 8
- keywords: _METALLICGLOSSMAP
- keywords: SHADOWS_DEPTH
passType: 8
- keywords: SHADOWS_DEPTH _METALLICGLOSSMAP
passType: 8
- keywords: SHADOWS_DEPTH _METALLICGLOSSMAP _OCCLUSION
passType: 8
6 changes: 3 additions & 3 deletions Packages/webxr-input-profiles-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.de-panther.webxr-input-profiles-loader",
"displayName": "WebXR Input Profiles Loader",
"version": "0.3.1",
"version": "0.3.2",
"unity": "2019.4",
"description": "Load WebXR Input Profiles in Unity",
"keywords": [
Expand All @@ -23,6 +23,6 @@
],
"dependencies": {
"com.unity.nuget.newtonsoft-json": "2.0.0",
"com.atteneder.gltfast": "2.5.0"
"com.atteneder.gltfast": "3.0.1"
}
}
}

0 comments on commit 7536f8a

Please sign in to comment.