Browse Source

fix for material with no texture

bstouls 10 years ago
parent
commit
5f53ecb9c7
1 changed files with 5 additions and 1 deletions
  1. 5 1
      tools/fbx/Viewer.hx

+ 5 - 1
tools/fbx/Viewer.hx

@@ -452,8 +452,12 @@ class Viewer extends hxd.App {
 			});
 
 			for( m in obj.getMaterials() ) {
+				var t = m.mainPass.getShader(h3d.shader.Texture);
 				m.mainPass.culling = None;
-				m.mainPass.getShader(h3d.shader.Texture).killAlpha = true;
+				if( t != null) {
+					t.killAlpha = true;
+					if( !t.texture.flags.has(IsNPOT) ) t.texture.wrap = Repeat;
+				}
 				if( m.mainPass.blendDst == Zero ) m.mainPass.blend(SrcAlpha, OneMinusSrcAlpha);
 			}