Skip to content

Commit

Permalink
Fix a couple minor TBT bugs
Browse files Browse the repository at this point in the history
- Quiet a false-positive warning.
  alphaMode=null should be treated as Opaque (according to the spec).
  Don't issue a "not yet supported" warning about that case.
- Fix detection of Google Blocks.

Change-Id: Id000b015d6b9800ebc731b352639d3252fb385c5
  • Loading branch information
dubois committed Feb 6, 2020
1 parent e070e68 commit 41bb112
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ private static Material LookUpGlobalMaterial(GltfMaterialBase gltfMaterial) {
string alphaMode = gltfMat.alphaMode == null ? null : gltfMat.alphaMode.ToUpperInvariant();

switch (alphaMode) {
case null:
case "":
case Gltf2Material.kAlphaModeOpaque:
baseMaterial = gltfMat.doubleSided
? TbtSettings.Instance.m_BasePbrOpaqueDoubleSidedMaterial
Expand Down
6 changes: 6 additions & 0 deletions UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ static bool GetBlocksVersion(string generatorString, out Version version) {
version = new Version { major = 1, minor = 0 };
return true;
}
// Likely it's "glTF 1-to-2 Upgrader for Google Blocks"
// No other Blocks version info, so assume 1.0
if (generatorString.Contains("Google Blocks")) {
version = new Version { major = 1, minor = 0 };
return true;
}
version = new Version { major = 0, minor = 0 };
return false;
}
Expand Down

0 comments on commit 41bb112

Please sign in to comment.