Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
2.99k stars 1.11k forks source link

How to have an occlusion material that also receives shadows #1021

Closed michelepanegrossi closed 9 months ago

michelepanegrossi commented 1 year ago

Hello!

Is it possible to add shadows to the 'PlaneOcclusionShader' shader supplied with ARFoundation? I don't think it receives shadows at present.

I cannot use the AROcclusionManager as the objects I want to use as occluding objects in my AR scene are too far away from the user.

Is there a better way of doing this?

Essentially I need occluding transparent objects that also receive realtime shadows when other objects get near them.

EDIT: I am working in URP on Unity 2021.3.8f.

Many thanks!

nextechar-hardik commented 1 year ago

1st solution for your issue : you can use Clipping planes setting.

if you want to hide object more then 3 meter then Set far value 3.

For getting shadow on Plane you can modify occlusion shader and that will work.

michelepanegrossi commented 1 year ago

Thanks @nextechar-hardik!

I don't need to clip objects actually, only make them occlude other objects but thanks for the tip! :)

I was wondering if shadows could be added to the occlusion shader but I have no idea how to do that (in URP as well). If anybody can help I would really appreciate it!

M

DavidMohrhardt commented 1 year ago

This issue is something that may get more traction on the forums as there are a number of expert users there who may be able to help. Please redirect any further responses to this forum post.

stale[bot] commented 1 year ago

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.

andyb-unity commented 9 months ago

Closing this issue due to inactivity. Feel free to re-open it if you have further questions.