问题
I have a newbie-questions regarding a 3D model I want to use in an AR App (with sceneform). The model itself is in .fbx format and I have 5 textures or maps (as .jpg files) for opacity, metal, roughness, base color and normal. Importing the .fbx model works, but I have no idea how to assign the textures to it. According to the documentation (https://developers.google.com/ar/develop/java/sceneform/custom-material), I need a .mat file. And that's my problem, how to create one. Manually or automatically. Where to start? Any idea/direction/good reading on the topic is helpful. Thank you in advance!
回答1:
Convert model to .sfb using sceneform plugin or using .gltf extension. On converted model or on model with .gltf extension, you can add texture on model pragmatically, there is a sample project for doing this on the following link
https://medium.com/temy/dynamic-textures-in-sceneform-98d7a2d35406
i implemented this in java. i hope this help you.
回答2:
You only need a custom material (and a mat file) if you want to create an own shader for your model. Setting your different maps will be done in the *.sfa file. Just use the Android Studio Sceneform plugin and import your FBX model. It will automatically create a SFA file and you can set your maps there. An overview about which maps can be set for an FBX model can be found here.
来源:https://stackoverflow.com/questions/58602123/how-to-prepare-a-3d-model-to-embed-in-an-ar-app