Transparent material issue
Hi,
Is there a way to make a completely transparent material ? Setting alpha to 0 is not doing it. Even with reflectance and roughness to 0. Whatever I try the object is still slightly visible. My goal is to use a transparent object for HitTest only.
Since detected plane can be fully transparent, is this issue due to sceneform or am I doing something wrong ?
Setting reflectance to 0 doesn't eliminate specular reflections entirely..Transparent objects still have some specular reflection.
If the object is unlit this should be doable.
Is there a way to unlit just some objects ?
You would want an unlit material, but thinking more on your use case let's not do that.
There is a simpler way to do this because you don't need to attach a Renderable at all to do HitTest.
You can set the collision shape on the node to
a Sphere or Box .
So it would look something like
Node node = new Node();
node.setParent(arFragment.getArSceneView().getScene());
node.setCollisionShape(new collision.Box(1, 1, 1)); /* or whatever size you want */
Thanks a lot ! While I am at it, if we can't have a fully transparent material, won't it be impossible to have a transparent plane made only for receiving shadows ?
One option is to make a node using a material with a transparent .png texture.
Custom materials are in an upcoming release. There are a lot of options for doing this:
- For changing the texture on the plane renderer you can checkout https://github.com/google-ar/sceneform-android-sdk/issues/48
- Custom materials will be in an upcoming release as well so you will be able to create more materials like this.
Custom materials are allowed with V1.3 The docs are up at https://developers.google.com/ar/develop/java/sceneform/custom-material
Hi,
@malik-at-work as you said:
Transparent objects still have some specular reflection.
Is this the reason why we have shadow - base .png with alpha (part of model), where transparent alpha is being visible/reflected? This is the result:

If so, does it mean that we can not use such shadows to avoid that reflection and rather let them be casted by renderer? Thank you for your reply.
I'm trying to interpret this. If I interpret this correctly you've baked self shadowing into a texture on the object? That is certainly doable, but I don't think it works if you want the shadow to appear on other objects.
Yes, we did baked shadow into model. And I know it won't appear on other objects. It is not a big deal for us.

I have to make it clear, the screenshot from previous post is not the best version. It does not actually have any shadow. Imagine that this texture supposed to be an shadow of object from previous post. Point is that even alpha on that texture is being reflected, which is not acceptable. Any ideas how to avoid this behavior?
Bonus question - when using renderer shadow casting I found an weird behavior:

The shadow is being casted on both vertical and horizontal planes which is one of the reasons why we decided to stick with baked shadows. Second one is cutting off an shadow in the border of horizontal planes (mentioned in this issue #80). Is there an option to handle those issues? I would not expect casting and shadows thru vertical planes. We have to decide whether to bake or not the shadows into models before we start modeling other models.
To avoid specular reflections your shadow material should be set to unlit.
@malik-at-work @romainguy Can u help me with this issue.
https://github.com/google-ar/sceneform-android-sdk/issues/450