Explorar o código

Added material "alphaMode" support to gltf.

Mark Sibly %!s(int64=7) %!d(string=hai) anos
pai
achega
c9c2b1a1e1

+ 2 - 0
modules/mojo3d/loader/gltf2.monkey2

@@ -75,6 +75,7 @@ Class Gltf2Material
 	Field emissiveFactor:Vec3f=New Vec3f(0)
 	Field occlusionTexture:Gltf2Texture
 	Field normalTexture:Gltf2Texture
+	Field alphaMode:String
 End
 
 #rem monkeydoc @hidden
@@ -419,6 +420,7 @@ Class Gltf2Asset
 			If jobj
 				material.normalTexture=textures[jobj.GetNumber( "index" )]
 			Endif
+			material.alphaMode=jmaterial.GetString( "alphaMode" )
 
 		Next
 		

+ 4 - 0
modules/mojo3d/loader/gltf2loader.monkey2

@@ -211,6 +211,10 @@ Class Gltf2Loader
 			
 		If normalTexture mat.NormalTexture=normalTexture
 			
+		Select material.alphaMode
+		Case "BLEND" mat.BlendMode=BlendMode.Alpha
+		End
+			
 		_materialCache[material]=mat
 		Return mat
 	End