Open stewe93 opened 5 years ago
The ShapeFactory is intended for the basic use case and doesn't have a normal map. Similarly the MaterialFactory doesn't expose all the functionality possible yet. For your use case I think the best way to go will be to package up materials in a sfb and use that.
Thanks @malik-at-work for Your response. I found a solution: in Unity I made a simple cube with the diffuse and normal map as material on it, exported, then in my code I'm creating a ModelRenderable from it and from the ModelRenderable I can get the material that I want (maybe it's make more sense to use the cube itself instead of just the material of it but my project now build around the ShapeFactory solution).
Maybe a better solution would be to use the Material
(Sceneform/Rendering lib) class Builder()
but 1, I don't know if that can build just the material from an sfb 2, it's private.
If this builder can build only the material from the sfb, would You mind to turn this issue to a feature request
and make that builder call public?
Yes, we are tracking the request to open up Material at https://github.com/google-ar/sceneform-android-sdk/issues/393 A +1 or me too on that ticket would be great.
Done, thanks for your time I'm really appreciate it!
Hy Guys! I would really appreciate Your help with this!
So first I created a normal cube with a color material (dont care about await, its for coroutines):
then I supplied it to to shape:
Now I would like to do the same with a custom texture material so changed the material to this:
My question is that if I have the normal map for the applied texture, how can I supply it to the material? I saw the Texture.Usage.Normal parameter but cant figure out how to apply it. My problem is that I cant set the colored texture png and the normalmap of that picture at the same time. Is there a way to achive this? I wouldn't like to make custom shapes and import them, my main purpuse is to build every shape from code!
Bests and thanks in advance