I'm following the google developers guide on adding Light to a Node in SceneView:
https://developers.google.com/sceneform/develop/build-scene
Light spotLightYellow =
Light.builder(this, Light.Type.FOCUSED_SPOTLIGHT)
.setColor(new Color(android.graphics.Color.YELLOW))
.setShadowCastingEnabled(true)
.build();
However it doesn't seem to do anything to my rendered model.
Is there anything else I'm missing?
ModelRenderable.builder()
.setSource(
this,
Uri.parse(card)
)
.build()
.thenAccept(
modelRenderable -> {
node.setParent(scene);
node.setLocalPosition(vector3);
node.setLocalScale(new Vector3(1.4f, 1.4f, 1.4f));
node.setName("Test");
Light light =
Light.builder(Light.Type.FOCUSED_SPOTLIGHT)
.setColor(new Color(android.graphics.Color.YELLOW))
.setShadowCastingEnabled(true)
.build();
node.setLight(light);
node.setRenderable(modelRenderable);
})
.exceptionally(
throwable -> {
Toast toast =
Toast.makeText(this, "Unable to load Fox renderable" + throwable, Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
return null;
});
.sfb
file for the model doesn't have a key named lit or unlit. But what I've noticed is, the default sun node in the Scene lights up my 3D model otherwise it's dark in the Android Studio 3D viewer. I'm now trying to add an additional light node (FOCUSED_SPOTLIGHT), but that doesn't make a difference to the rendered model. – Buehrer