Topic locked

Shadows don't work in latest Vuforia Unity SDK

March 24, 2016 - 4:23pm #1

Vuforia SDK Version: 5.5.9 -

Description with steps to reproduce:

I can't get shadows to work at all in latest Unity SDK.  There's something in the new Video Background Manager that's killing them.  Unchecking enable video background makes everything show ok. 

Steps to reproduce:

1. Open Image target example

2. Add a 3d plane to one of the targets underneath the teapot

3. Turn on hard shadows in the light

4. Open up project settings -> quality and change shadow distance so you can see shadow.

You'll now see a shadow, press play and point at a target.  No shadow appears in the video view.

See image.  Shadows work as they should on Vuforia 5.0.10.

https://dl.dropboxusercontent.com/u/58996651/shadows.jpg

-

Development OS (Mac OS X, Windows, Linux): osx 10.10.5 -

Mobile OS and Version: Any iOS or android device -

Mobile Device Manufacturer and Model name: Any -

Do the Vuforia Sample Applications show the same behavior?: Yes, see steps above.

Shadows don't work in latest Vuforia Unity SDK

August 9, 2016 - 3:00pm #7

Hello,

This issue was resolved in Vuforia 6.

Thanks.

Shadows don't work in latest Vuforia Unity SDK

March 30, 2016 - 11:21am #6

just ran into this today, thanks for the fix!

Shadows don't work in latest Vuforia Unity SDK

March 30, 2016 - 6:24am #5

Thank you!!!  Confirmed working.  Appreciate the quick turn around.

 

Shadows don't work in latest Vuforia Unity SDK

March 30, 2016 - 12:24am #4

Hi,

could you try and add this script to your scene (you can attach it to a game object of your choice, for example to the ARCamera):

using UnityEngine;
using System.Collections;
using Vuforia;

public class FixProjectionMatrix : MonoBehaviour, IVideoBackgroundEventHandler
{
    private Camera[] mCameras;

    // Use this for initialization
    void Start()
    {
        mCameras = VuforiaBehaviour.Instance.GetComponentsInChildren<Camera>();
        VuforiaBehaviour.Instance.RegisterVideoBgEventHandler(this);
    }
    
    // Update is called once per frame
    void Update () {
    
    }

    public void OnVideoBackgroundConfigChanged()
    {
        foreach (var cam in mCameras)
        {
            var projMatrix = cam.projectionMatrix;
            for (int i = 0; i < 16; i++)
            {
                if (System.Math.Abs(projMatrix[i]) < 1e-6)
                {
                    projMatrix[i] = 0.0f;
                }
            }
            cam.projectionMatrix = projMatrix;
        }
    }
}

 

This should fix the problem.

A permanent fix should be included in the next release of Vuforia.

 

 

Shadows don't work in latest Vuforia Unity SDK

March 29, 2016 - 6:37pm #3

Thanks, any possible workaround or even just confirmation would be very helpful.  This is currently holding up our project, we need the new Android bug fixes and can't go back to the previous version.  

I'm wondering if there's something that can be done in the video background shader to make it work in the mean time...

 

 

Shadows don't work in latest Vuforia Unity SDK

March 25, 2016 - 8:23am #2

Thanks for the report.

We'll try to reproduce the issue with the steps described and report back as we get more information on this.

 

Topic locked