Cast light on a real surface in AR

Hello,

I use Unity 2019.X with ARFoundation 4.X and plane detection and need to achieve casting/rendering light (e.g. use spotlight) on a ground plane, which should be transparent as it would represent the real world ground surface. I found online resources regarding casting shadows but nothing about this issue, except of the following which is old and is not very clear on the procedure followed:

What is the best practice to achieve this?

Thank you!

There is a part in AR Foundation called Occlussion.
Do you mean you want to make something like this?

If so, then you can see this guy do www.youtube.com/watch?v=QbAY963xp0c
Hopefully can help.

Thank you but what I need is for light to be able to be rendered on the plane surface acting as the ground.

As it can be seen below, the light is only rendered on opaque geometry, i.e. the rock in this case and no light is rendered/casted on the plane:

Hi @petroslouca

This is actually a graphics problem that AR Foundation does not attempt to solve. It is possible to write custom shaders to accomplish an AR re-lighting effect, but it would fall to you to implement or find a plug-in to accomplish this.

Thank you! A third-party solution could exist in AssetStore…

Maybe you could render to texture the cam feed, then stick that texture into a special material and apply that to a large plane. Then that plane can receive shadows, but also light.

Probably will need to be something special, otherwise you’ll see the plane to begin with, and never see the cam background…

Well just my 2 cents and currents thoughts.

Now, somebody put that into practise and see if it works :slight_smile:

Thank you!

Thank you! I believe that this feature should be included as is as important as the shadow, there is a shader for the latter built-in ARFoundation!

We have noted the feature request-- thanks!!

If you have a scene with enough contrast you can try with an aditive render shader. Its not the same… but maybe its enough for your case.