google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

Render distance limit #498

Closed ArtsemKurantsou closed 5 years ago

ArtsemKurantsou commented 5 years ago

Is there any way to increase render distance? I've noticed that when object is far then 30 meters it disappears. Can it be configured some how?

claywilkinson commented 5 years ago

At this time there is no way to set the far clip plane. Setting this would also impact how ARCore works which makes it much more difficult to change.

One option would be for you to scale down nodes beyond 30m and draw them accordingly.

valnenov commented 5 years ago

I am facing the same problem. Can you please advise if there is a workaround solution to this issue besides scaling down the nodes, which is not acceptable in my case?

ArtsemKurantsou commented 5 years ago

Hi @valnenov . Unfortunately I wasn't able to find workaround. I tried to scale and rotate nodes manually but it worked woeful.

valnenov commented 5 years ago

Thanks for you prompt feedback Artem. I guess we have to wait for Google and hope for this to be addressed in the next release of ARcore:-) Please let me know if you come up with some solution before that and I will do the same.

guerwan commented 5 years ago

We have the same issue, @claywilkinson any plans to add control over the far clip plane in a future release?

guerwan commented 5 years ago

After investigation, you can use : arFragment.getArSceneView().getScene().getCamera().setFarClipPlane(…);

vortice3D commented 5 years ago

Hi there:

Any tips on this issue? ...or must I change to ARKit in order to implement architectural-type AR experiences (50-60m is a must)? I've read that iOS (SceneKit) let you a far clipping plane of 1Km.

Best regards.

vortice3D commented 5 years ago

Hi there again:

After tweaking a bit the code with the setFarClipPlane call, I've finally managed to have it working.

My fault was to call that API after the Renderable had been already attached to node.

Best regards.

aj019 commented 5 years ago

@vortice3D Can you show a code snippet to make it clear what you actually did and in which file ?

chnouman commented 4 years ago

@olancedev what it is doing can you explain little?

vortice3D commented 4 years ago

Hi there:

First of all, please excuse me for the xtra-delay.

Said this, the needed code is fairly straightforward. In the onCreate method of your AR activity you only need to write something like this:

... _arFragment =(CustomARFragment)getSupportFragmentManager().findFragmentById(R.id.ux_fragment); ... _arFragment.getArSceneView().getScene().getCamera().setNearClipPlane(0.5f); _arFragment.getArSceneView().getScene().getCamera().setFarClipPlane(750f); ...

Best regards.