I was just messing around with the Wikitude Unity plugin and everything works fine so far. I was wondering, does the Unity plugin also support shadows?
I tried it out with a 3D object that appears when the marker is in field of vision. I added a directional light (shadow type: "soft shadows"). I checked the cast shadows/receive shadows checkboxes on my objects and the shadows appear in the scene view. But as soon as I test on my device the shadows are not visible anymore. Are shadows supported?
Thx for help.
A
Alexandru Florea
said
over 7 years ago
Hi,
Thank you for pointing this issue out. I also tested and it seems that because the scale of the object at runtime is much smaller, the shadows are not rendered correctly by Unity. We are looking into ways to improve this.
You can work around the issue by going into quality settings and changing the Shadow Distance to a much smaller value (for example 1). Also, in the inspector of the directional light you should change the bias to something like 0.001. And make sure that the quality settings are also set for the platform on which you are running (Android or iOS).
Best regards, Alexandru
J
Josef.wolfartsberger
said
over 7 years ago
Hi,
Thanks for the quick response. So far, I couldn't manage to display shadows on Android. I tried it with soft and hard shadows, changed the shadow distance in the quality settings and modified the bias of the directional light. I made sure that quality settings and quality level are set for the right platform. Did it work for you?
My test device: Samsung Galaxy TAB S2 9.7 (SM-T810) @ Android 5.0.2
A
Alexandru Florea
said
over 7 years ago
Hi,
There is indeed an issue with shadows on Android. I couldn't find a workaround, but will continue to investigate the issue. This is something that we want to support and I will let you know if I find anything new. Sorry for the inconvenience.
Best regards, Alexandru
J
Josef.wolfartsberger
said
about 7 years ago
Hi,
I just read the notification that the Unity plugin update was released, but the download page still shows version 1.2.1-1.1.0 (21.03.2016). Where can I get the new one?
E
Eva
said
about 7 years ago
Hello Josef,
We plan to put the latest Unity release version by the end of today so stay tunned!
Thank you
A
Alexandru Florea
said
about 7 years ago
Hi,
The Unity plugin update is available now from our download page. Shadows should work now for both platform.
Best regards, Alexandru
J
Josef.wolfartsberger
said
about 7 years ago
Cool, thanks!
I was just wondering... In this video you display the object's shadows only, without having some virtual floor or something.
Can you tell me, how you achieved this effect? Do you use an invisible ground object with some shader that renders the shadows only? Anyhow, looks quite nice :-)
A
Alexandru Florea
said
about 7 years ago
Hi,
Yes, we had a transparent quad that used a shader to render only the shadows. I've attached the shader code below. You should be able to test it in the editor as well.
Best regards, Alexandru
J
Josef.wolfartsberger
said
about 7 years ago
Thanks, the Shader works fine!
In my scene, I noticed a weird flickering effect at the shadow's edges. Can you share your directional light settings and quality settings in your scene? I think there's some tweaking necessary.
A
Alexandru Florea
said
about 7 years ago
Hi,
What we used is this:
Hard Shadows Only High Resolution Stable Fit Shadow Distance: 80 Shadow Near Plane Offset: 2 No Cascades
Of course, results will vary based on how big your scene and how long you want the shadows to be. Keep in mind that by changing the scale of the trackable, the distance from the camera to the trackable changes too, so if you scale your trackable up, the distance will increase and you will also need to adjust the Shadow Distance parameter.
Best regards, Alexandru
J
Josef.wolfartsberger
said
about 7 years ago
Hi again,
I notices some weird flickering on my Samsung Galaxy Tab 2 when working with Unity and shadows, see screenshots below. The second one (same Unity scene) is from my old Nexus 4, where everything looks fine. Did you encounter similar problems?
On the devices we tested, we didn't have these issues. You could try playing around with the Bias, Normal Bias and Shadow Near Plane settings in the Light component inspector and maybe it will help with your problem.
Josef.wolfartsberger