我正在使用 Rajawali 3D 框架并尝试从 SD 卡加载 .obj 文件。当我将这些文件(.obj、.mtl、texture.png(可绘制文件夹))放在原始文件夹中时,我能够上传和解析 obj 文件,但是当我尝试从 sdcard 解析它时,它说:
[org.rajawali3d.materials.Material] Could not compile fragmentshader:
Shader log: Fragment shader compilation failed.
这是我从 SD 卡上传 .obj 文件的代码:
private Object3D Object;
LoaderOBJ objParser = new LoaderOBJ(this,"Load/1c_obj");
try {
objParser.parse();
Object = objParser.getParsedObject();
getCurrentScene().addChild(Object);
} catch (ParsingException e) {
e.printStackTrace();
}
日志猫:
D/Rajawali﹕ Parsing: /storage/emulated/0/Load/1c_obj
D/LoaderOBJ﹕ Found Material Lib: 1c_mtl
D/LoaderOBJ$MaterialLib﹕ Parsing material: Texture0
D/LoaderOBJ$MaterialLib﹕ Parsing material: Texture1
9578-9612/com.example.loadobj D/LoadModelFragment$LoadModelRenderer﹕ startRendering()
E/Rajawali﹕ [org.rajawali3d.materials.Material] Could not compile fragment shader:
9578-9612/com.example.loadobj E/Rajawali﹕ Shader log: Fragment shader compilation failed.
ERROR: 0:13: '.' : Syntax error: syntax error
ERROR: 1 compilation errors. No code generated.