sceneform-android-sdk icon indicating copy to clipboard operation
sceneform-android-sdk copied to clipboard

Custom material only

Open dyavil opened this issue 8 years ago • 5 comments

Hi,

Is there a way to generate a custom material without applying it on a renderable ? For exemple to create a sizable plane for shadows only (with a real transparent material)?

dyavil avatar Jul 02 '18 09:07 dyavil

Do you mean you'd like to be able to create an .sfb file that only contains a material but no rebderable definition?

romainguy avatar Jul 03 '18 07:07 romainguy

More or less, I want to use a created material (using .mat file) but for runtime generated renderables. It seems that to do so I have to create a dummy renderable (sfa/sfb) with that material and copy that material at runtime. I'm looking for a way to have a custom material without a renderable (cf ".sfm" mentioned here)

dyavil avatar Jul 03 '18 08:07 dyavil

Thanks for the info, that's what I thought you meant.

romainguy avatar Jul 03 '18 08:07 romainguy

Right now, materials can only be loaded from a Renderable. Creating a dummy Renderable with the material and then calling renderable.getMaterial() to access the material is the recommended workaround.

dsternfeld7 avatar Jul 04 '18 00:07 dsternfeld7

If you are looking to turn off the visualization of the plane without turning off shadows, you can do arSceneView.getPlaneRenderer().setVisible(false);

dsternfeld7 avatar Jul 04 '18 00:07 dsternfeld7