I'm trying to start developing for the Hololens 2.
Instead of using Unity to create a 3D app, my intention is to create a "desktop app" with C#.
After installing the Windows Mixed Reality App Templates from the Microsoft Marketplace, I tried to create a C# project but VS gets stuck in the progress bar while creating the project and after several minutes displays the following message:
This issue is somewhat approached in this MS page: Creating a holographic DirectX project, in which it says:
If your holographic C# project didn't start from the Windows Holographic app template, you'll need to copy the ms.fxcompile.targets file from a Windows Mixed Reality C# template project and import it in your.csproj file to compile HLSL files that you add to your project.
It is clearly a known issue by Microsoft, but that's all there is to it.
Even with VS completely stuck, it does create the files for the project, and all the files mentioned above are present but i does not open properly.
What should I do to make the C# project work? Have anyone else faced this?
PS.: The C++ project template works fine.
Thanks.
When you say you want to create a "desktop app with C#", are you referring to a 2D app or a volumetric app?
2D apps are a breeze, you just create a regular UWP C# project [Blank (App Universal Windows)] and then build and deploy it for ARM64 to your HoloLens 2 and it will just work. No special templates required. Regular UWP apps that run on the desktop also run on the HoloLens. You can do a few things to optimize them for HoloLens and/or Windows Mixed Reality but you don't require any special templates.
See these links for more info:
Designing for Mixed Reality and
Building 2D Apps
If on the other hand you are trying to create a volumetric 3D experience in C# that involves DirectX there is a template in the Windows Mixed Reality templates that leverages SharpDX, look for the "Holographic DirectX11 App (Universal Windows)" the template without the "(C++/WinRT)" trailing text. It is a C# option that leverages the opensource SharpDX wrappers. There is mention of that option near the end of this "Creating a UWP project" section of the
Creating a holographic DirectX project page.
Related
I would like to build an app that uses augmented reality. To be honest, i prefer Android Studio, but i realized, that Unity3D with Vuforia might be the best choice for me. Im intrested in the best solution, to build my app in Android Studio, but clicking on a button (this will be my main usecase), i open the augmented reality project, i built in Unity. What would be the best solution?
UPDATE
Here is what i found:
First way:
I make my project in Unity, and exporting the project (add the module name to dependencies:
dependencies{
compile project(':UnityClasses')
}
Then importing it into Android Studio. Then i could talk between modules like this:
How-to-call-method-and-return-its-value-with-unityplayer-unitysendmessage
If im correct here, in this way i can send data to Unity module within Android Studio by the 3rd parameter of UnitySendMessageExtension, and i can send data back by the Callstatic method.
Second way:
Use Unity as a Subview
Third way
Integrating Unity into Android Studio
Can anyone help me, who tried these above, to tell me what the best way is?
Unity is a full development solution, so you really do not need to mix up with android studio.
And additionally, Unity is fully compatible with whatever you need because it is C# based so in addition to Unity specific support, anything that works for C# will work for Unity as well.
and here is a link to the Unity firebase SDK:
https://firebase.google.com/docs/unity/setup?gclid=EAIaIQobChMI56nk0-Cb2QIVAilpCh2GOw6zEAAYASAAEgIPZfD_BwE
The only real difference is if you don't like to program 50% visually 50% C# in Unity VS programming in javandroid (that's what I call whatever is going on in android studio ^-^').
Plus Unity exports to everything while android studio is exclusive to android devices, so developing for Unity has greater benefit.
EDIT:
You can call Android OS features written in java or c++, from C# by using the Native Plugins functionality:
https://docs.unity3d.com/Manual/AndroidJARPlugins.html
https://docs.unity3d.com/Manual/NativePlugins.html
as well as extending the main activity with your own activities
https://docs.unity3d.com/Manual/AndroidUnityPlayerActivity.html
All these features are there for when you want to do more than just games, like architectural visualization or whatever other app that requires 3D manipulations like AR.
I am trying to organize my Monogame project in a way which would simplify cross-platform targeting. However, since I am working on Windows, Xamarin Studio doesn't offer the "Monogame Universal App" or "Monogame/iOS" templates, but only templates for Shared projects and Android projects:
Xamarin Studio on Windows does not include iOS templates. Developers working on Windows need to add all code files to a project-specific Android project or manually add either a PCL or shared code project.
Since this is a Monogame project, I feel like most of the game logic and drawing should be abstracted through Monogame classes. But if I create a new Android solution in Xamarin studio, it creates a single project which contains the main Activity along with the Game class which references Mono.Android and OpenTK directly. Furthermore, included About*.txt files imply that I should be accessing resources through designer-built Resource class, which is tied directly to Android.
OTOH, if I create a "shared Monogame Xamarin project" in Xamarin Studio, it's completely empty (only a Game1 template class, but not even a reference to monogame, so it doesn't compile at all).
Is there a walkthrough/template for creating a shared Monogame project, with content which can be processed differently for each target platform?
I saw this solution here so I downloaded and tried to run but I've never used XNA and the website from the link doesn't have any instruction/documentation...
Anyone who uses it have any suggestions?
(I don't have xna... I'm trying to use monogame)
Another rather classic solution is to install XNA framework included in Windows Phone SDK 7, create a separate XNA solution just for the purpose of building XNB files.
To get XNA working on your computer (for VS2010 - VS2013) first download Windows Phone SDK 7 and 8 (both of them) from here:
https://dev.windowsphone.com/en-us/downloadsdk
And then you can install XNA implementation for VS2010 - VS2013 from here:
https://msxna.codeplex.com/releases
Once all is installed, just create a new XNA Game solution. XNA will automatically create two projects for you, one of which is "Content" project, where you can place all your assets (pictures, sounds, fonts). After compilation you will get your XNB files created.
I'm trying to add a new MonoGame content project (via templates installed in the MonoGame 3.0 installer) to an existing solution in Visual Studio 2012 (Professional), but it always comes up with the following dialog box:
It does create a few empty folders where the project should be, though they don't have anything in them. After this popup it also comes up with this:
I do not have XNA installed as VS2012 does not support it.
Also, I am using Windows 7.
Thank you!
If i were you I would read the three blog posts that Tara Walker has made about Windows 8 game development starting with this one: Overview, Installation and MonoGame 3.0.
The third blog post talks about creating a Content Pipeline outside of Mono Game (using XNA) and importing it into your MonoGame project. It sounds like you will need XNA so you'll need to read through her information and figure out how to get it working in VS2012 Express.
I've been dabbling with a MonoGame project in my spare time and I have been able to load some textures and sprite sheets without a dedicated content project; everything is just added to the project solution and created during initialization of the main class. But I don't know if this is viable in the long term.
HTH.
Mono Content Project depends on the XNA as MONOGAME is still working on truly independent CONTENT MANAGER. So as off now we have to intall XNA. Download it from XNA zip and unzip the content because XNA is not officially supported by MS.
Read the attached readme and install as mentioned. Don't forget to intal the file in zip folder named
"XNA Game Studio 4.0 (2012).vsix" which installs the "XNA" template for VS.
Now try to create a sub-project for your content. Your problem should be fixed !!
Is there anyway to easily do this? Changing the Target framework or other properties doesn't work.
You can look for more clues in the XNA Windows game project template, found in this path:
VS_INSTALLDIR\Common7\IDE\VPDExpressExtensions\Microsoft\XNA Game Studio 4.0\ProjectTemplates\XNA Game Studio 4.0
Look for the Windows Game template called XnaWindowsGame-v4.0.zip
A simpler way may be creating a new Windows project, and a new XNA project, and comparing the .csproj files for both projects using a text editor (.csproj is nothing but a custom XML file).
I suspect the XNA project has a few extra tags in it specifying XNA related information, but in its essence it compiles to a Windows executable, so making these changes to the Windows .csproj file should "convert" it into an XNA project.