Camera only shows a black screen

June 17, 2015 - 2:57pm #1

Hi,

I’m struggling with combining Unity and iOS native framework.

I’m following the way of subclassing as decribed here  http://forum.unity3d.com/threads/unity-appcontroller-subclassing.191971/page-3

It worked well under unity4.5.3f + vuforia 3.0.9 .

But under unity 4.6.6p1 + vuforia 4.2.3 it's not working.
(To make my app 64bit compatible, I need to stick to this combination of the newest versions.)
Unityview has been loaded, but Camera isn't working, only displaying a black screen.

I’m using the following overridden method:

- (void)createViewHierarchyImpl

{

    _rootController = [[UnityDefaultViewController alloc] init];

    _rootView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    _rootController.view = _rootView;

    

    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboardIPad" bundle: nil];

 

     self.navController = [mainStoryboard instantiateInitialViewController];

     [_rootView addSubview:self.navController.view];

}

and I got this error :
VideoBackgroundConfig with screen size of zero received, skipping config step.

Anyone can help me?

Camera only shows a black screen

June 30, 2015 - 12:49pm #7

You're welcome ;-)

Camera only shows a black screen

June 30, 2015 - 9:28am #6

Thank you for your answer !

Now it works like a charm~

 

The resaon we need to subclass the UnityAppController is that this app was originally built on iOS native frameworks 

and we were trying to replace some parts of it with Unity things. 

 

If we stick to Unity only, we will end up losing the existing parts

and rebuilding the whole things in Unity is impossible under our current conditions. 

 

Thank you again~!

 

 

Camera only shows a black screen

June 28, 2015 - 11:51pm #5

Hi,

when subclassing the UnityAppController with your own custom implementation, you will need to register Unity Plugin Render events for Vuforia, otherwise the video background may fail to render (hence seeing black screen);

to do that, in your UnityAppController class implementation (.m file) you'll need to add this code:

- (void)shouldAttachRenderDelegate
{
    self.renderDelegate = [[VuforiaRenderDelegate alloc] init];
 
    UnityRegisterRenderingPlugin(NULL, &UnityRenderEvent);
}

 

You will also need to add this import statement (in the same file):

#import "VuforiaRenderDelegate.h"

 

may I ask you why you need to subclass the UnityAppController ?

Camera only shows a black screen

June 26, 2015 - 1:35pm #4

Thank you for your response.

But I had that exact same settings: oepnGL ES 2.0, IL2CPP, Universal.

An app built with Unity alone works well, but one build by subclassing appController doesn't work.

Camera is displaying the black screen with the error of 

"VideoBackgroundConfig with screen size of zero received, skipping config step".

 

We can't proceed any further due to this.

This is very important for us.  

Any help will be appreciated.

Thank you

Camera only shows a black screen

June 24, 2015 - 1:36am #3

@VProduction:

if you are using Unity 4.6.x, and you're building for iOS, make sure to have the following Player Settings (iOS):

- Graphics API: OpenGL ES 2.0

- Scripting backend: IL2CPP

- Architecture: Universal

These settings allow building a Vuforia app for both 32bit and 64bit on iOS, with correct rendering.

 

Camera only shows a black screen

June 23, 2015 - 12:55pm #2

I set up with 64bit Unity but got a black screen as well. You need to run 32 bit Unity. 

Topic locked