Start a new topic

Does the Unity Plugin support shadows?

Does the Unity Plugin support shadows?


Hi,

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.   

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

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

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

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?

Hello Josef,

We plan to put the latest Unity release version by the end of today so stay tunned!

Thank you

Hi,

The Unity plugin update is available now from our download page. Shadows should work now for both platform.

Best regards,
Alexandru

Cool, thanks!

I was just wondering... In this video you display the object's shadows only, without having some virtual floor or something.

https://www.youtube.com/watch?v=7VEkSZEO-jU

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 :-)

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

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.

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

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?

https://www.dropbox.com/s/mqmtm379luqfwvb/bowling_galaxyTab.png?dl=0
https://www.dropbox.com/s/g268rvjg4l1mgg2/bowling_nexus.png?dl=0

Hi, 

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.

Best regards,
Alexandru
Login or Signup to post a comment