google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

RenderableSource apply custom material #373

Closed bobekos closed 5 years ago

bobekos commented 5 years ago

Hi,

since SceneForm 1.5 we got the option to import gltf models at runtime. Is there a possibility to apply custom material reference to the renderable source? As i can see you can manipulate only the scale and the recenter mode attributes.

vs-dos commented 5 years ago

Maybe this issue can help you.

bobekos commented 5 years ago

Hi @c0deminded ,

not really no. If you convert a gltf model over android studio you can set a specific .mat file to the output sfb. With SceneForm 1.5 you can create a sfb at runtime but there is no option to point to a custom material file. So if you app must download the model files you can only download ready to render sfb's files. You can't download for example a gltf and convert it at runtime to sfb with specific material.

vs-dos commented 5 years ago

Sounds like a feature that needs to be added. However, you can work around this issue if you download gltf on your phone , convert it to sfb with a standard material definition , and then do as above. Assign a custom material definition and maps that are used. Not the best way, but it should work.

bobekos commented 5 years ago

Hallo @c0deminded

thanks for the response. But as far as I know there is no option to add (not modify) a new custom material at runtime. Or am I blind?

bobekos commented 5 years ago

@c0deminded Forget everything I said. Are you f!%&"§& kidding me? I overlooked the setMaterial method. :D