Closed ishaang10 closed 5 years ago
Just a suggestion, you could make a large transparent plane (e.g 10m) using the pose + center of the current plane found. If this material is set to show shadows, you ll see shadows on much larger area and they would not get clipped off.
thanks for the reply.. I am thinking the same but now my problem is that how to disable the current shadows from my model. also how to make a seperate plane and cast the shadows?
arSceneView.getPlaneRenderer().setShadowReceiver(false);
will disabled the shadows on the default planeRenderer.
You can create your own plane by making a mesh based on the detected plane specifics: Look at com.google.ar.sceneform.rendering.PlaneVisualizer and com.google.ar.sceneform.rendering.PlaneRenderer
You can create your own PlaneNode and PlaneVisualizer classes inspired from these.
thanks . currently i set the node.setshadowcaster(false) .
i added a light in my scene. so do you haveany idea how can i change the local position of that light as i canot se any setlocalpos method for the light.i want it to be above my node
To deactivate the default shadow is a really good idea. The problems with the default shadow are even worse than before with version 1.7.
Another default not useable.
@ishaang10 Yes you can position a light. It's a node itself. Here is an example placing light at Position 1, 1, 1
`
Node light = new Node();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
light.setLight(Light.builder(Light.Type.POINT)
.setColor(new Color(-863292))
.setIntensity(200)
.build());
}
light.setLookDirection(new Vector3(0.7F, -1.0F, -0.8F));
light.setParent(sceneView.getScene());
light.setWorldPosition(new Vector3(1,1,1));
`
Let me know :)
is there a way my node cast shadow by only this light and not the default one on the plane? thanks
(I think) The shadows will always be based on all the lights in the scene.
You can though disable the default sunlight and add your own lights wherever you want: sceneView.getScene().getSunlight().setEnabled(false);
Do you know the default location of the sun or the default light.. i mean if i were to set all the properties same just change the location of the sun (x axis) then it would be awesome
Since sun is a node, I think you can getWorldPosition() on it.
"All other functionality in Node is supported. You can access the position and rotation of the sun, assign a collision shape to the sun, or add children to the sun. Disabling the sun turns off the default directional light."
https://developers.google.com/ar/reference/java/sceneform/reference/com/google/ar/sceneform/Sun
You should get familiar with the documentation. It's really useful.
thanks a lot sir :)
Newer URL to the Sun: https://developers.google.com/sceneform/reference/com/google/ar/sceneform/Sun
i want my model to have shadows even outside of the detected plane