* OBJ loader will warn you if you're using lit meshes without normals

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7514 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 14 years ago
parent b428d8ac48
commit cbefb99eed
  1. 7
      engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java

@ -45,6 +45,7 @@ import com.jme3.scene.Mesh.Mode;
import com.jme3.scene.Node; import com.jme3.scene.Node;
import com.jme3.scene.Spatial; import com.jme3.scene.Spatial;
import com.jme3.scene.VertexBuffer; import com.jme3.scene.VertexBuffer;
import com.jme3.scene.VertexBuffer.Type;
import com.jme3.scene.mesh.IndexBuffer; import com.jme3.scene.mesh.IndexBuffer;
import com.jme3.scene.mesh.IndexIntBuffer; import com.jme3.scene.mesh.IndexIntBuffer;
import com.jme3.scene.mesh.IndexShortBuffer; import com.jme3.scene.mesh.IndexShortBuffer;
@ -409,6 +410,12 @@ public final class OBJLoader implements AssetLoader {
else else
geom.setQueueBucket(Bucket.Opaque); geom.setQueueBucket(Bucket.Opaque);
if (material.getMaterialDef().getName().contains("Lighting")
|| mesh.getFloatBuffer(Type.Normal) == null){
logger.log(Level.WARNING, "OBJ mesh {0} doesn't contain normals! "
+ "It might not display correctly", geom.getName());
}
return geom; return geom;
} }

Loading…
Cancel
Save