Przeglądaj źródła

improved glTF PBR loading

Daniel Salvadori 7 lat temu
rodzic
commit
a9c620390e
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      loader/gltf/material_pbr.go

+ 8 - 0
loader/gltf/material_pbr.go

@@ -17,6 +17,14 @@ func (g *GLTF) loadMaterialPBR(m *Material) (material.IMaterial, error) {
 
 	// Create new physically based material
 	pm := material.NewPhysical()
+	pm.SetTransparent(true) // TODO when to set this to true?
+
+	// Double sided
+	if m.DoubleSided {
+		pm.SetSide(material.SideDouble)
+	} else {
+		pm.SetSide(material.SideFront)
+	}
 
 	// BaseColorFactor
 	var baseColorFactor math32.Color4