Hello there,
I can’t find a way to cast shadows in ARCore, is there some solution to this? I tried with planes and shadow shader that I use in Vuforia, but it does not work with ARCore.
Hello there,
I can’t find a way to cast shadows in ARCore, is there some solution to this? I tried with planes and shadow shader that I use in Vuforia, but it does not work with ARCore.
Shadow casting is something you have to make yourself on top of ARCore. You need to add a light source with shadow casting enabled, you need to add a plane that receives shadows (and that plane need to be aligned with the tracking plane), and you need to use objects that have cast shadows enabled.
The plane that receives the shadows need to have a transparent material that receives shadows, in order to make it look like the shadows are cast onto the “real world”. Such a shader isn’t included in the ARCore package, but I’ve attached one here. It’s made in Amplify Shader Editor, but you should be able to use it without Amplify.
But what about the size, I need to make my targets small, but shadows are pixalated, because ARCore is using real life measurements, like 0.1f is 10cm. Can I make 1f equal 10cm? I need larger objects for better quality shadows.
Try to decrease shadow distance under quality settings
I’ve tried this shader. Thank you, by the way.
But it renders the ground plane opaque grey.
This worked for me GitHub - jonas-johansson/ARCoreUtils: Unity plugin that adds shadow and collision to ARCore.