arfoundation-samples icon indicating copy to clipboard operation
arfoundation-samples copied to clipboard

Model edges are jagged using AR Occlusion

Open craig026 opened this issue 6 years ago • 14 comments

I have used the AR Occlusion Manager in a few projects and I seem to be getting a 'jagged' look to model edges (see screenshot) instead of smoothed edges that I have seen in other examples.

I am using a Samsung Galaxy Note 10. Any ideas?

Thanks.

OcclusionScreenshot2

craig026 avatar Jul 08 '20 03:07 craig026

Could you tell us what your quality setting is for Environment Depth in the AROcclusionManager?

mdurand42 avatar Jul 08 '20 22:07 mdurand42

I have tried all three quality settings for Environment Depth in the AROcclusionManager and the same effect happens. The screenshot is using the 'Best' Environment Depth Mode.

craig026 avatar Jul 09 '20 01:07 craig026

OK. We will try with a Note 10 or similar and try to observe whether there is a similar result.

mdurand42 avatar Jul 09 '20 05:07 mdurand42

Great, thanks for looking into it.

craig026 avatar Jul 09 '20 05:07 craig026

I also noticed the same issue.

devhims avatar Jul 11 '20 15:07 devhims

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 15 '20 03:09 stale[bot]

Hi,

Did you manage to take a look into this issue?

Thanks.

craig026 avatar Sep 15 '20 03:09 craig026

The raw depth image has a much lower resolution than the camera image. We try to smoothly upsample it; however, the ability to do this depends on GPU feature support, and certain GPUs do not support this.

For instance, a Samsung S9 with a Qualcomm GPU allows for smooth upscaling, whereas an S9 with a Mali GPU does not. The "jagged" rendering artifacts you see are likely a result of your device specs, and there's not much that can be done to improve the result. Have you tried the same scene on any other device?

tdmowrer avatar Sep 23 '20 00:09 tdmowrer

Thanks for the explanation. I've only tried it with a Galaxy S10 and Note 10 - the same effect happens on both devices but as they were bought in Australia, they both appear to have a Mali GPU.

I'll see if I can test it on a device with a better GPU, but for now it seems like it's just down to the device I'm using.

Thanks for looking into it!

craig026 avatar Sep 23 '20 02:09 craig026

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 30 '20 03:09 stale[bot]

Is this issue really due to device support? Older versions of ARCore depth lab (eg 1.1.1) had very smooth occlusion, however the same devices have jagged occlusion as in the above screenshot.

environmentDepthTemporalSmoothingSupported returns supported, and Depth images are nicely smoothed when environmentDepthTemporalSmoothingRequested is set to true, however occlusion always has jagged edges.

I have tested on a number of Samsung devices and all have the same issue.

stents avatar Dec 18 '21 16:12 stents

@stents you may want to open a new issue. I no longer work at Unity, and it's unlikely anyone else will see your comment on this closed issue.

tdmowrer avatar Dec 19 '21 01:12 tdmowrer

Ah yes, sorry @tdmowrer, had not noticed it was closed before I posted. Thanks for the reply. In case anyone else is looking for smoother occlusion on devices with this issue, my current solution is to use a custom ARCameraBackground material with a shader that does a gaussian blur on the Environment Depth texture. There's probably a better solution, however this does the job for now...

stents avatar Dec 19 '21 02:12 stents

Looks like the degree of jaggyness is related to the quality settings in project settings. After switching to ultra quality, it's no longer jagged for me

image

image

ethanfischer avatar Aug 06 '23 03:08 ethanfischer