Open basitsaleemmb opened 6 years ago
In https://github.com/google-ar/sceneform-android-sdk/issues/426 I added sample code to create a ValueAnimator which adjusts the "color" property on a material.
For your modelRenderable, you will need to ensure it is using materials which can be transparent and that have a color property. You would then need to set the color for each material in the renderable to fade it out.
Hello
I' m trying to do the same thing, but it's not working right now. @malik-at-work I tried your solution. but the alpha channel is not working properly for me. When I set the alpha to 0, my model is completely invisible. But when I set the alpha to something different from 0, my model is always visible at the same transparency.
MaterialFactory.makeTransparentWithColor(context, Color())
.thenAccept {
val model = ShapeFactory.makeCylinder(0.5f, 2f, Vector3(0.0f, 1f, 0.0f), it)
model.isShadowCaster = false
renderable = model
model.material.setFloat4(
MaterialFactory.MATERIAL_COLOR,
Color(1f, 1f, 1f, 0.1f)
)
}
Also I tried to create a custom Material with the blending option to "fade" as suggested here #196. But I have the same problem. Any idea?
hi! i want to fade out my modelRenderable when it is clicked is there any solution?