Skip to content

Commit 798412e

Browse files
authored
updated to gltfast 5.0.0 (#16)
1 parent 6a549b9 commit 798412e

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#1.1.5
2+
- Updated gltfast to 5.0.0
3+
14
#1.1.4
25
- Changed dependency name as the package name was rolled back
36

Runtime/GLTFastWrappers/DecentralandMaterialGenerator.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public override Material GenerateMaterial(GLTFastMaterial gltfMaterial, IGltfRea
4141
{
4242
var specGloss = gltfMaterial.extensions.KHR_materials_pbrSpecularGlossiness;
4343

44-
SetColor(specGloss.diffuseColor);
45-
SetSpecularColor(specGloss.specularColor);
44+
SetColor(specGloss.DiffuseColor);
45+
SetSpecularColor(specGloss.SpecularColor);
4646
SetGlossiness(specGloss.glossinessFactor);
4747
SetBaseMapTexture(specGloss.diffuseTexture, gltf);
4848
SetSpecularMapTexture(specGloss.specularGlossinessTexture, gltf);
@@ -56,7 +56,7 @@ public override Material GenerateMaterial(GLTFastMaterial gltfMaterial, IGltfRea
5656

5757
if (roughness != null)
5858
{
59-
SetColor(roughness.baseColor);
59+
SetColor(roughness.BaseColor);
6060
SetBaseMapTexture(roughness.baseColorTexture, gltf);
6161
SetMetallic(roughness.metallicFactor);
6262
SetMetallicRoughnessTexture(gltf, roughness.metallicRoughnessTexture, roughness.roughnessFactor);
@@ -65,10 +65,10 @@ public override Material GenerateMaterial(GLTFastMaterial gltfMaterial, IGltfRea
6565

6666
SetBumpMapTexture(gltfMaterial.normalTexture, gltf);
6767
SetOcclusionTexture(gltfMaterial.occlusionTexture, gltf);
68-
SetEmissiveColor(gltfMaterial.emissive);
68+
SetEmissiveColor(gltfMaterial.Emissive);
6969
SetEmissiveTexture(gltfMaterial.emissiveTexture, gltf);
7070

71-
SetAlphaMode(gltfMaterial.alphaModeEnum, gltfMaterial.alphaCutoff);
71+
SetAlphaMode(gltfMaterial.GetAlphaMode(), gltfMaterial.alphaCutoff);
7272
SetDoubleSided(gltfMaterial.doubleSided);
7373

7474
SRPBatchingHelper.OptimizeMaterial(material);
@@ -216,7 +216,7 @@ private void SetAlphaMode(GLTFastMaterial.AlphaMode alphaMode, float alphaCutoff
216216
{
217217
switch (alphaMode)
218218
{
219-
case GLTFastMaterial.AlphaMode.MASK:
219+
case GLTFastMaterial.AlphaMode.Mask:
220220
material.SetOverrideTag(ShaderUtils.RENDERER_TYPE, "TransparentCutout");
221221
material.SetInt(ShaderUtils.SrcBlend, (int)BlendMode.One);
222222
material.SetInt(ShaderUtils.DstBlend, (int)BlendMode.Zero);
@@ -231,7 +231,7 @@ private void SetAlphaMode(GLTFastMaterial.AlphaMode alphaMode, float alphaCutoff
231231

232232
break;
233233

234-
case GLTFastMaterial.AlphaMode.BLEND:
234+
case GLTFastMaterial.AlphaMode.Blend:
235235
material.SetOverrideTag(ShaderUtils.RENDERER_TYPE, "Transparent");
236236
material.SetInt(ShaderUtils.SrcBlend, (int)BlendMode.SrcAlpha);
237237
material.SetInt(ShaderUtils.DstBlend, (int)BlendMode.OneMinusSrcAlpha);

Runtime/GLTFastWrappers/DefaultMaterialGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public override Material GenerateMaterial(global::GLTFast.Schema.Material gltfMa
1616
{
1717
Material generatedMaterial = base.GenerateMaterial(gltfMaterial, gltf);
1818

19-
if (gltfMaterial.emissive != Color.black) { generatedMaterial.SetColor(emissiveFactorPropId, gltfMaterial.emissive * CUSTOM_EMISSIVE_FACTOR); }
19+
if (gltfMaterial.Emissive != Color.black) { generatedMaterial.SetColor(EmissiveFactorProperty, gltfMaterial.Emissive * CUSTOM_EMISSIVE_FACTOR); }
2020

2121
return generatedMaterial;
2222
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "com.decentraland.unity-shared-dependencies",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"displayName": "Unity Shared Dependencies",
55
"description": "This package contains shared dependencies between unity-renderer and asset-bundle-converter repositories, this includes gltf importer wrappers and shaders",
66
"unity": "2021.3",
77
"unityRelease": "14f1",
88
"dependencies": {
9-
"com.atteneder.gltfast": "5.0.0-exp.1"
9+
"com.atteneder.gltfast": "5.0.0"
1010
},
1111
"author": {
1212
"name": "Decentraland",

0 commit comments

Comments
 (0)