Sfoglia il codice sorgente

Fixed a few gltf material issues.

Mark Sibly 7 anni fa
parent
commit
f3efeed3fd

+ 1 - 1
modules/mojo3d/loader/gltf2.monkey2

@@ -400,7 +400,7 @@ Class Gltf2Asset
 					material.metallicFactor=jpbr.GetNumber( "metallicFactor" )
 				Endif
 				If jpbr.Contains( "roughnessFactor" )
-					material.metallicFactor=jpbr.GetNumber( "roughnessFactor" )
+					material.roughnessFactor=jpbr.GetNumber( "roughnessFactor" )
 				Endif
 			End
 			

+ 3 - 1
modules/mojo3d/loader/gltf2loader.monkey2

@@ -181,7 +181,9 @@ Class Gltf2Loader
 		Endif
 			
 		Local mat:=New PbrMaterial( boned )
-
+		
+		mat.Uniforms.LinearColors=True
+		
 		mat.ColorFactor=New Color( material.baseColorFactor.x,material.baseColorFactor.y,material.baseColorFactor.z )
 		mat.MetalnessFactor=material.metallicFactor
 		mat.RoughnessFactor=material.roughnessFactor

+ 3 - 0
modules/mojo3d/render/material.monkey2

@@ -35,6 +35,9 @@ Class Material Extends Resource
 	End
 	
 	#Rem monkeydoc @hidden The material uniforms.
+	
+	TODO: Should really be protected...
+
 	#End
 	Property Uniforms:UniformBlock()