WebGPU, Cesium Unity 1.20.0 - Observations, Comments, Possible Bugs

Hello Cesium Team and forum Dev’s :slight_smile:
We have been building a rather large project and have run into a few issues.
So, we backed up in time, to test our project against the suggested Cesium Unity samples project.
Below you will find pics, links and comments.
The stats are as follows…

  • Using Unity 6.3.1f1 LTS
  • Unity Hub 3.15.4
  • Cesium Package 1.20.0 For Cesium Sample Project
    (Which, by the way, is missing a signature.)
  • Cesium Sample Project w/ Google Photorealistic 3D Tiles, Using all, out of the box, Cesium & Unity settings. Compiled for WebGPU
  • The Cesium Sample project compiled for WebGPU w/ Brotli Compression is 13.1 Meg
  • Our project compiled for WebGPU w/ Brotli Compression is 38.5 Meg and uses Cesium Package 1.21.0
  • For testing Windows Stand Alone & P.C. WebGPU tests, we use a brand new Alienware 18 w/ Processor Intel(R) Core™ Ultra 9 275HX, 2700 Mhz, 24 Core(s), 24 Logical Processor(s)
  • For testing Mobile I am using an old Samsung S9. But, I have also tested on Brand new IOS & Samsung devices and the results, surprisingly, are not noticeably different.

    Pic above: Cesium Samples Project set w/ WebGPU build running from our server over the internet w/ Google Chrome.
    Url Link to the above project WebGPU Test: Unity Web Player | cesiumunitysamples

Our Observations:

  • Both this Sample project and our personal project run excellent compiled for stand alone on Windows and Mac.
  • Both projects run not as well w/ slower load times through the web using wireless on Windows and Mac through Chrome, Fire Fox and Win Explorer.
  • Our project running on Mobile through ATT and Chrome has a VERY slow load time the same with tile load time, while running but does load and run. (BTW, our project is set with Cesium Package w/ 1.21.0 (Which is also missing a signature.)
  • The Sample project, on Mobile, loads but after loading we are left waiting with a black screen.

Issues needing attention:
The main issues we would like to bring to your attention are 4 fold:

1.) Your Cesium Camera, although it works smoothly when using the keyboard keys, while using a mouse the rotation of viewing consistently maintains a jerky motion which is very disruptive and we are concerned of how this will work running thru XR headsets with possibly causing sickness. While researching this problem we find many others have brought this up and there is info about this internet wide but apparently persists as a problem.

2.) The viewing and camera rotation all around 360 degrees works very well (With the exception of No. one above.) on Windows and Mac stand alone builds but running from our server from a WebGPU build we can not turn around and go back to where we started or view 360 degrees and come around full circle as we are stuck where the curser stops at the screen edges. Maximum viewing rotation is around 45 degrees. This occurs looking right, left or up, down. Apparently this is a browser constraint and either you should maybe come up with a work around or all browsers need to address. We have come up with a work around but it is not the way it should be…

3.) I expect this one is a Unity thing for @brendan-duncan, When running on WebGPU Mobile there is no way to move or zoom. No controls at all! I read somewhere this is an individual developer concern where if required can be added by dev’s coding and Dev’ing. :slight_smile:

Sure would be nice if Cesium offered this. Actually, it would be good if Cesium had a Mobile Sample scene all set up in the next Samples package. Just a thought :slight_smile:

4.) This one, I believe is for @brendan-duncan, as through research, this is apparently a Unity issue. This spamming is somewhat irritating… And it was mentioned on a different Cesium post that this is a Unity thing!

- All in all, Cesium for Unity is a heck of a product! We love it!

  • @brendan-duncan work has been instrumental with the last piece of the puzzle where the fate of the web’s future is no longer at stake! Thanks Brendan! Awesome conversing with you :slight_smile:
  • I have been looking forward to all these pieces coming together since 2000…
  • Unity’s new WebGPU system coupled with Cesium for Unity has so much potential!!!
  • Anyone’s advice or thoughts on how to get Cesium settings the best they can be for WebGPU Mobile will be greatly appreciated…
  • We reailize the WebGPU systems by both Unity and Cesium are in “Experimental” Status. So, please take this post as a request for advice and guidance.
  • Thanks everyone!!!

I can at least answer 3 and 4 while I’m waiting on a build to finish:

  1. This is indeed an individual developer thing to add mobile controls to your app. How this is done, whether with onscreen controls or just handling touch input, is quite specific to the individual app, and therefore requires a dev to do some dev’ing. I don’t remember how the sample projects are set up if they have mobile controls enabled and they’re just not activated when running on web. Would be worthwhile to set that up if it’s not.

  2. The physics team was going to be adding a way to filter those warnings. When that API gets added, we’ll update cesium_unity to use that filter to keep it from spamming the console. The warning itself is coming from PhysX. I’ll check in on the progress of that project.

@brendan-duncan
As always! Chop chop and Brendan gits 'er done!!!
Thank you sir!
We’re getting close!

Hi @Paul_Kueber,

I’ll try to answer some of your questions below. Apologies it’s mostly “more questions” rather than answers.

Which is also missing a signature.

Can you elaborate on this? It’s true we’re not signing any of the files in the release package, but I wasn’t aware there was a need to, either.

Your Cesium Camera, although it works smoothly when using the keyboard keys, while using a mouse the rotation of viewing consistently maintains a jerky motion which is very disruptive and we are concerned of how this will work running thru XR headsets with possibly causing sickness. While researching this problem we find many others have brought this up and there is info about this internet wide but apparently persists as a problem.

Have you noticed a frame rate drop simultaneous with the jerky motion? Or is it unrelated to frame rate? I’m not sure what’s going on here, but any further information you can provide will be helpful. If it’s reported elsewhere, please include links so that we can connect the dots.

from a WebGPU build we can not turn around and go back to where we started or view 360 degrees and come around full circle as we are stuck where the curser stops at the screen edges

I’m not quite sure what is the proper way to do with this, but it sounds like it would be a general problem with Unity WebGPU builds. Perhaps @brendan-duncan knows how people usually deal with this, and if there’s something we should be doing in our DynamicCamera to improve things?

For the last question, sounds like the app needs to use cursor lock, Unity - Scripting API: Cursor.lockState, so that the cursor his hidden and the mouse movement is independent of the visible cursor. You usually set this on a mouse down event.

Side note about setting the cursor lockState: the web is finicky and sometimes it won’t happen until you click on the canvas again, due to the web security requirements of setting the cursor lock state, and how input events are handled in unity.

Hello @Kevin_Ring , @brendan-duncan & All Forum Dev’s…
Yes Kevin, when a door is opened with a question, there are almost always more questions :slight_smile: Thanks for the response’s guys!
I am still working on answering your questions. So, I will post these responses in multiple posts…
First, here is a pic from the package manager showing no “Signature”
This does not cause issues but should be addressed…


Second, I created a short video showing both the Cesium Samples project and Showing one scene from my personal project showing movement using Smooth key board key’s movement and Jerky cursor rotation movement. I suggest you view the WebGPU Samples project that I included a link in the first post to check Smooth keyboard movement VS Jerky cursor rotation movement. When checking rotation movement, I suggest moving cursor horizontally or vertically slowly back and forth. I included a Unity Stat’s window which of course shows FPS and I see NO excessive FPS problems… This problem is constant in both WebGPU and Windows StandAlone compiled projects!
The Cesium Samples project shows both the Smooth VS Jerky camera movement and if you move the cursor off screen you will see viewing complete 360 is not possible when losing focus. We tried “Cursor Lock” but did not work!
We will try again!
…Here (Again) is a direct link to my compiled WebGPU Cesium Samples project

…Here is a link to the new video…

…Here is a pic from Google AI describing losing focus in WebGPU/GL and not being able to view 360, all around.

           More answers yet to come!
            Thanks fellas!

Like I and AI said, Cursor.lockState = CursorLockMode.Locked is your solution “360” for the web, as CursorLockMode.Confied is not supported because you cannot move the hardware mouse cursor from a web page. Imagine going to a web page that takes over your mouse! That would suck. When you go into mouse lock, where the cursor becomes hidden and you’re tracking delta mouse movements rather than mouse position, the browser overlays a banner informing you that you can press Escape to get out of that mode.

When you do set the Cursor.lockState to Locked, it will queue the request until the next time you actually click on the canvas, because it requires an explicit user action to engage. Unfortunately event handling that happens in C# usually happens outside of the JS event handlers, so it can be a bit cumbersome requiring a second click on the canvas to actually engage.

My flight test project, Unity Play | WebGPU Cesium Flight game, uses cursor lock. I request the cursor lock on the Fly button press event. It doesn’t always get locked when that happens, sometimes you get lucky, sometimes it’ll get locked if you click the mouse on the canvas again. Making no promises that it’s a well written Unity project, the source is at GitHub - brendan-duncan/unity_webgpu_cesium_flight: Cesium for Unity Web toy flight simulator using WebGPU, with the cursor lock logic in unity_webgpu_cesium_flight/Assets/GameManager.cs at main · brendan-duncan/unity_webgpu_cesium_flight · GitHub, OnPlayClicked method.

Hi @brendan-duncan :slight_smile:
We experimented with the “Lock State” but our efforts did not pan out…
But, now with the info you shared, we will take another shot at it and see if we get the “Go Code” with a "Launch Sequence! :slight_smile:
Your info looks very helpful… Will let you know if we “Blast Off”…
Thank you very much!!!

Thanks for the info about signing @Paul_Kueber. It looks like a new feature in Unity 6.3 that I hadn’t noticed yet. I wrote an issue for this here.