Your Unity games and XAML: How many of you actually use it?

Hello, dear developers targeting Windows!

We had a discussion internally whether we should make the D3D project type the default in future versions of Unity. XAML has several disadvantages, some of which are more prevalent on phone scenarios.

Disadvantages of XAML project type:

  • It increases game startup time by around 1 second;
  • It increases memory usage by ~10 MB. On phones when you have 180 MB memory budget, it is quite a lot.
  • There's an extra blit of swapchain contents to xaml layout at the end of each frame.

Disadvantages of D3D project type:

  • You can't use XAML elements
  • On screen keyboard experience is a little bit poorer on Windows 10

So the question remains: do YOU rely on XAML in your game? If so, what do you use it for? Would you switch to D3D even if you currently used XAML due to XAML disadvantages?

Note, we are not going to remove XAML. We're merely thinking about changing the default.

I didn't even realize you can can choose to build a D3D solution until i checked it because of this poll..
XAML is default, so I didn't think i should mess around with that
not sure what will D3D give me, but i don't use any XAML in my application

I would only use XAML to introduce Ads really as Unity Ads are not supported. Although from an Application instead of Game point of view I would say XAML could be very valuable.

Personally though I think changing the default would make sense as it would align it closer to the other platforms.

We currently use XAML to display a web browser component as well as a video player component to smooth stream videos. I am unsure how easy it would be for us to do this without XAML.

The nice thing about the XAML front-end is that it runs on a separate thread... I'm not sure a core gets dedicated to it, but can be used to do some very interesting things.

I used it primarily for UI stuff as it support SVG, data binding, and custom controls in an easy to use XML like syntax.

Regardless of the benefits, I think it would be ok to not make it the default moving forward now that Unity has an improved UI system (although SVG would be a nice to have supported feature).

I also wanted to note that the on screen keyboard is a big deal to our project, and it was a blessing when it started working well.

Yes. Mainly positioning Ads.

So long as the guidance is clear, it shouldn't matter what the default is, most devs I've spoken to will choose speed of UI flexibility.
XAML is mainly used for Ads, or in (a fair few) cases where start up speed is paramount, in which case, devs opt to have a XAML game menu before launching the game.

So long as the platform features (Cortana, Location, Notifications) are not affected by going D3D, it should be fine. I think most are XAML by default because it's not absolutely clear in the docs that there is another choice.

Our game uses dll libraries and those dll libraries use XAML controls. Will the libraries still work if they use XAML and I build the game in D3D?

[quote=“kshitijgandhi”, post:9, topic: 606588]
Our game uses dll libraries and those dll libraries use XAML controls. Will the libraries still work if they use XAML and I build the game in D3D?
[/quote]

Most likely not.

Assuming that Unity uses a SwapChainPanel in xaml to utilize DirectX in the xaml project, does this mean building the project as Universal 10 D3D will improve frame rate? If so, has Unity done any benchmark testing? ie 1%, 5%, 20% improvement? Obviously, every project will get different results but I'm assuming the swapchain overhead is going to be fairly consistent for a give screen resolution on the same hardware.

[quote=“sstrong”, post:11, topic: 606588]
Assuming that Unity uses a SwapChainPanel in xaml to utilize DirectX in the xaml project, does this mean building the project as Universal 10 D3D will improve frame rate? If so, has Unity done any benchmark testing? ie 1%, 5%, 20% improvement? Obviously, every project will get different results but I’m assuming the swapchain overhead is going to be fairly consistent for a give screen resolution on the same hardware.
[/quote]

It really depends on the GPU. Unless you’re fillrate bound, it shouldn’t have any impact. Otherwise, it depends.

I would like to embed unity in XAML as part of a bigger XAML app.. but never found any examples how to easily do this

1 Like