Vuforia based Unity3d Game blurry camera - c#

I had been trying a app that I developed in Unity3d on multiple android devices.
For some reason in some devices the camera seems blurry.Can anyone help me out please?

FOCUS_MODE_CONTINUOUSAUTO works well on all of my Android devices. Read the article below for more info.
https://developer.vuforia.com/library/articles/Solution/Camera-Focus-Modes
We encourage using FOCUS_MODE_CONTINUOUSAUTO in your applications whenever it is available on the device. When setting this mode, if the return value of setFocusMode() is TRUE your application will provide sharp camera images for both superior rendering, as well as for robust tracking performance.

Related

Joining a channel on Agora (Unity/iOS) makes in-game music almost inaudible

I'm trying to integrate Agora voice SDK in a multiplayer project (built using Photon). The level has loads of 3D spacial audio setup and a background music that is properly audible. The moment I join a voice channel, all the in-game audio levels drop drastically. The voice chat volume itself sounds fine however. And this happens only on actual device(iOS), not on Unity editor.
I tried reproducing this issue in the HelloUnity3D sample scene that comes with the SDK. No code change. Simply added an audio source in the scene with a music clip. Seems to be happening there as well.
Is this expected? How do I keep Agora from modifying other audio sources?
Unity version:2020.3.28f1. Agora SDK version: 3.5.0.70
For anyone running into this issue, I was able to fix it by setting the audio profile to AUDIO_SCENARIO_GAME_STREAMING.
mRtcEngine.SetAudioProfile(AUDIO_PROFILE_TYPE.AUDIO_PROFILE_SPEECH_STANDARD, AUDIO_SCENARIO_TYPE.AUDIO_SCENARIO_GAME_STREAMING);
The idea is to simply treat the voice chat audio as media volume instead of 'call' volume.
This answer about audio ducking with the Agora SDK is likely what you're after. You might have to add some iOS specific code to your project to achieve it:
https://stackoverflow.com/a/62840934/2156765

Keep Unity program working in background after device goes to sleep?

I'm working on a Unity project that uses the device camera for AR purposes (I'm using AR Foundation). I currently have it set so that the device won't go to sleep (because I want it to operate for long-periods without user-interaction). Specifically, Screen.sleepTImeout = SleepTimeout.NeverSleep. If I didn't have this, then the device would go to sleep, and the program would stop functioning. Does anyone know if there is a way to keep the program working in the background after the device goes to sleep...similar to how music apps keep playing music? I've come up empty handed after a few hours of searching for a solution. Any help would be greatly appreciated!!!
Some people aren't finding this in more recent versions of Unity. But it's still there: In Player settings, under the section "Resolution and Presentation", you find "Resolution" and below that, there's "Run In Background".
This is only available for Web players and standalones (Anything Except IOS And Android Pretty Much), though (you won't find it when you have the iOS, Android or Flash tab selected.

Unity android Native Camera as WebcamTexture

Can someone help me about to use the Native Camera of Android in Unity the same way we use WebcamTexture? I want the "camera preview image" in Unity as a texture2d or texture.
Thanks in advance.
I did it once using https://bitbucket.org/Unity-Technologies/graphicsdemos as starting point. You are going to be interested in the RenderingPlugin.cpp.
Back in the day I had to use code in Java as bridge to Android NDK since it was not possible to plug an ImageReader in the camera feed on the C level due to security reasons.
It looks like things got updated and it might be possible to simplify the architecture by using https://github.com/googlesamples/android-ndk/tree/master/camera.
Hope this helps.
ps-> In case you want to do a code walkthrough I put together an end-to-end demo here https://github.com/robsondepaula/unity-android-native-camera

How to use vuforia on PC Application

i'm new on vuforia and i need some help with this topic.
Can someone tells me if its possible use vuforia with a webcam on a pc application?
I got webcam frames on a plane texture and i tried to pass those textures to vuforia but i have not got it work.
I used WebCamTexture to get frames of webcam.
I'm not familiar with Vuforia (although it looks interesting, I'm going to try that out myself this weekend!), I might have a suggestion.
Is it possible Vuforia doesn't know what to do because of the images being WebCamTexture instead of something like Texture2d?
WebCamTexture is a Texture (Texture2D, WebCamTexture, RenderTexture all extend from Texture but they aren't exchangeable).
So, try to convert your texture and pass that on to Vuforia?
var tx2d = new Texture2D();
tx2d.SetPixels((go.renderer.material.mainTexture as WebCamTexture).GetPixels());
EDIT: What I found here, under the section Running in the editor:
There is a specific Web Cam Behaviour script.
To use Play Mode for Vuforia in Unity Pro, simply select the attached,
or built-in, webcam that you want to use from the Camera Device menu,
and then activate Play Mode using the Play button at the top of the
Editor UI.
You can also use the standard Unity Play Mode with non-Pro Unity
versions and by setting ‘Don’t use for Play Mode’ in the Web Cam
Behaviour component.
To use standard Play Mode, adjust the transform of the ARCamera object
to get your entire scene in view, and then run the application in the
Unity editor. There is no live camera image or tracking in standard
Play Mode, instead all Targets are assumed to be visible. This allows
you to test the non-AR components of your application, such as scripts
and animations, without having to deploy to the device each time.
Have you tried the $250 plugin at http://holographi.space/ ? I haven't paid $250 for it yet.

Writing Windows Media Center Extender

I recently purchased an XBox 360 and was first introduced to the term "Media Extender". I didn't realize that windows had the ability to stream content to an XBox and was very surprised and excited. I also noticed that people wrote their own plugins that allowed streaming of, for example, netflix. I would like to know more about how to do this but find it hard to even Google it because I know so little about the terminology (I'm not sure whether the XBox is the "extender" or the "extender" is a plugin that makes the Xbox stream). Can anybody explain this technology to me and perhaps direct me to good getting started reference for building my own plugins (for instance, to stream Pandora to the Xbox)?
An Xbox 360 is a Windows Media Center Extender device, implemented in software on the Xbox. Dedicated hardware implementations exist, such as this, but I don't think they've ever taken off like they were supposed to.
Windows Media Center can be extended via its APIs for building add-ins. Take a look at this Google search.
In my experience (we use this in our lounge) not all plugins seem to work via the Xbox 360 - some work only on the PC.
Hope this helps some.

Categories