Disclaimer : This article concerns Computer Graphics which I follow with my M2 "Virtual and Augmented Reality" at IPParis.
For Both of them we want to implement our project on our phone so in Build Settings change your Build to Mobile and switch Platform. If you have any issues you can check on this previous article. Maybe you need XR plugin and Android plugin we already install in previous labs.
Vuforia :
Installation
- Windows package Manager :
- Asset store install "Vuforia Core samples", when importing a project it will erase what you've done so far. Be careful and do it before starting your project.
- click on Resources > VuforiaConfiguration, it will say you don't have the latest version of Vuforia, go on this link and add it in Package Manager as they explain. To check if you do it correctly in Package manager click on "Unity Project" and select "In Project", you must see it. Moreover, errors disappeared.
- Next step, register yourself on this website, then go to license and create a free one :
Click on it and copy the key and paste it in vuforiaConfiguration>App License Key. We're almost there.
Let's start :
- Delete the main camera and add Vuforia Engine > ARCamera and also an ImageTarget, select an ImageTarget :
- Now add what you want to make appeared as a child of it and test it :
You're ready !
Some notes :
- If you want to use your own pictures :
- Import the image in your asset click on it and change "Texture Type" to "Sprite (2D/UI)"
- Some advices : your picture must be : Rich in detail, Good Contrast, No repetitive patterns, format
Unity Foundation :
AR with Unity Foundation :
Install AR Foundation & ARCore XR plugin [if you are on Iphone download ARK, I won't treat this part]. Make Sure you Install the latest version :
- Some steps : create an object XR > AR Session origin and add those 3 scripts : AR Session / AR Input Manager / AR tracked image manager
- Create an object and make it a prefab (you can delete it from the scene). Add it in Tracked Image manager (Script).
- In AR tracked image manager you need a reference image library, it's a database of image, the advantage of this method is that you can change only the database instead of creating a new project. As I already said : be careful to change your image Format to "Sprite 2D"
- some settings before build :
- Project Settings : XR Plugin Management : Android enabled ARCore
- Project Settings : Player: Other Settings : Graphics APIs : Remove Vulkan
- Project Settings : Player: Other Settings :Minimum API level : take at least API lvl24
- We are close to the end, As you see you could not build it. The Last step is to follow this link. Normally explanations are clear
You're ready ! You can Build it
My Project :
- First scene gives a little intro which explain the purpose of the app :
- Then you just have to scan the box of a BoardGame to have a little animation of it, here are some examples :
- Note that I only implement for the games in this list : The Crew, Code Name, Super Colt Express, Munchkin, RISK, SubTerra, The Mind et TREK.