Topic locked

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 14, 2015 - 2:56am #1
Hello
We are using the Vuforia in Unity.
 
There is a problem that occurs when replacing the front camera on the back of the camera.
 
Help me..
AttachmentSize
Image icon Back.jpeg430.78 KB
Image icon Front.jpeg518.96 KB

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 19, 2015 - 11:21pm #12

You're welcome 

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 19, 2015 - 10:51pm #11
It solved thanks to you.
Thank you very much ~!
AttachmentSize
Image icon self.jpeg488.54 KB

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 19, 2015 - 4:12am #10

Thanks for the additional info and screenshots.

From the Unity scene screenshot I can see that you have an object called "Fixed Character Camera"; is that an additional Camera that you use to render the character 3D model ?

If that's confirmed, you should be able to solve the issue by adding this simple script to your "Fixed Character Camera":

 

using UnityEngine;

public class BackfaceCulling : MonoBehaviour

{

  void OnPreRender() {

    GL.SetRevertBackfacing(false);

  }

}

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 19, 2015 - 2:27am #9
  • How is your Light configured in the Scene ? 
     : Directional Light only one.
  • Do you have a directional or point light ?
     : I have a Directional Light.
  • Is the light attached at root level in the scene, or is it a child of the ARCamera ? (or other setup) ?
     : light attached at root level in the scene
     

Attach file 
unity full shot

light Inspactor shot

AttachmentSize
Image icon unity.png194.01 KB
Image icon light.png43.58 KB

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 17, 2015 - 11:50pm #8

When using the Front Camera you should use the Mirroring enabled (ON);

note that there is a known issue in Vuforia 4.0 and 4.2 with enabling Front camera plus Mirror = OFF, which results in the video background to appear vertically flipped (upside down) when the device is oriented in PORTRAIT;   you could however use LANDSCAPE orientation and Mirror = OFF (this works).

 Ideally the Mirror option should be left to ON when using Front Camera, cause that's a more natural option for front camera Augmented Reality; however, if I understand correctly, this is causing the shading / lighting issue that you showed in your original post;

  • How is your Light configured in the Scene ? 
  • Do you have a directional or point light ?
  • Is the light attached at root level in the scene, or is it a child of the ARCamera ? (or other setup) ?

 

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 17, 2015 - 7:52pm #7

Thank you for Reply.

(Translate Google..)

But, It has not been resolved.

 

I found the reason.

Mirror Video Background of ARCamera is a problem.

Attached photo ("Mirror") is to turn off the Mirror Video Background option.

However, a problem occurs when you turn off the option.

For example, the position of the Target Image move in reverse.

 

Is there another workaround?

 

Help me~

AttachmentSize
Image icon Mirror.jpeg387.75 KB

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 15, 2015 - 11:10pm #6

Thanks for the additional details;

it seems in your code you need to add one line after the Camera Stop:

CameraDevice.Instance.Stop

CameraDevice.Instance.Deinit();

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 15, 2015 - 10:31pm #5

- Unity version : 5.0.1f1 Personal

- Vuforia SDK version : vuforia-unity-mobile-android-ios-4-2-3.unitypackage

- Android or iOS :  Android 4.4.2

- Does it happen on a specific device or multiple devices ? if device specific, what Device Model ?

  Multiple Devices / Galaxy Note 2, Galaxy Tab

 

Sorry. I do not speak English well. T_T   (Google Translate)...

Please let us know if you did not understand this part. I tell it again.

 

I try to position your character in the middle of the smartphone screen to unity.

Vuforia of the camera (A) is located on the top Creating a new Unity Camera (B) was placed in front 3D Characters.(SetActive (false))

Use CameraDevice.Instance.Init() brought changes to the front / back camera of your smartphone.

 

The AR Camera outside in the Image Target Unity Camera (B) the SetActive (true).

The 3D character appears as an image. ("Back" image)

 

When changes to the front of the camera,

If you recognize the Image Target in front of the camera appears well-3D characters. But outside the Target Image it will appear as "Front" image.

 

Unity Scene Image -> "Unity" File.

AttachmentSize
Image icon Unity.png56.07 KB

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 15, 2015 - 1:49pm #4

@ cubin03,

the topic / issue described by kugumo in the first post is a bit different from what you mention and it refers to a rendering issue that seems to affect the shading / appearance of the 3D models used as augmentation (see the screenshots that kugumo attached).

You mention an issue with "camera upside down / or frozen", which is a different issue. Could you please create a separate thread for that ?

 

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 15, 2015 - 11:43am #3

Having same or similar issue.

When swapping from Back facing camera to front, the camera image initializes upside down and is frozen. Swapping back to Rear facing camera has same results.

Exiting the scene and returning restores the camera behavior until a swap is requested again.

No errors in device logs or xCode debugger

Not happening with previous version of vuforia v4.0.105

Unity: v4.6.5f1

Vuforia: v4.2.3

OS: iOS

Devices: iPad2 or later / iPhone 4 or later

Problem(Swap from CAMERA_FRONT to CAMERA_BACK)

May 15, 2015 - 6:53am #2

Hi,

Could you specify:

- Unity version

- Vuforia SDK version

- Android or iOS

- Does it happen on a specific device or multiple devices ? if device specific, what Device Model ?

 

 

Topic locked