I am building my first game in android. When I play in the editor everything works fine, but when I build and run I get huge lag to the point where it is unplayable. I have attached the profiler and it looks like this:
Does anyone have any suggestions on how to fix this please?
In my case it was due to Multithread Rendering. After disabling Multithread Rendering in Player settings a Semaphore.waitForSignal not appeared in profiler anymore.
By the way it doens't fixed the issue with CPU performance and enabling such option looks reasonable for devices with multiple or advanced (more than 1 thread) cores. But at least it helped to face with another errors for investigation the root cause ^^
Related
I'm developing a quiz game and want it to run on browsers.So far the game only loads to about 90% of the progress bar, then the tab freezes. A browser warning shows up at the top saying that something is making the page slow. This happens both when the game is run locally or from a server.
The PC works fine and I wasn't able to find the problem so far. I tried playing wwith the build player configs and reducing all textre max sizes (solved the problem in this post https://forum.unity.com/threads/webgl-stuck-at-90-loading.532707/).
The last lines shown on the console before the load freezing are the json files readings. So I think it might have something to do with them.
If anyone has any idea it would be a great help.
You should also make sure that WebAssembly streaming is disabled in the player settings, that 100% causes webgl to get stuck at 90% loading.
I am having a issue where i suppose to load a large number of objects in my scene on an event,
so when ever i start loading these Scenesmy Vive/vr goes to compositor screen and it kinda flickers between my main scene and compositor screen
until my loading of Scenes is finished.
So my question is how to stop this flickering, i am happy to call the compositor screen till my Loading is completed and then it switch back to my Main scene or something like that which can solve this flickering issue
i have been searching around that how to call compositor screen on my own or how to stop it being called when my Loading is in progress but in vein.
any help would be much appreciated because i am out of ideas.
Thanks...
Flickering and showing compositor screen is generally caused by Unity not being able to Render a frame. I'm sure you will be able to find which object(s) (if any in particular) is causing a lag in the Profiler Tab.
I assume by "Loading" objects you mean Instancing them. If so, it depends:
a) If you instancing multiple identical objects - look up into GPU instancing methods
b) if the objects aren't unique, you may try to:
Load scene asynchronously
Place all (deactivated) objects on the first scene and instead of instancing or
loading new scene, just activate them. This will only increase initial loading
time.
Another things that you can use is:
Single Pass Stereo Rendering
use of ONLY or mostly baked lightning - which will SIGNIFICANTLY increase performance (that let me display in real time VR scene with model that counts more than 40 million vertices)
By default, SteamVR fades to grid whenever an app hangs. While of course it's ideal to keep your framerate above the threshold that would normally trigger this, there are many cases (such as loading scenes) where all the optimization in the world won't keep Unity from hanging long enough to trigger this issue.
Fortunately, this behavior can be disabled entirely! SteamVR Settings -> Developer -> Do not fade to grid when app hangs. This setting can be also be changed in the steamvr.vrsettings file which can be found using vrpathreg.exe. There, set steamvr.doNotFadeToGrid to true. This file is modified by the SteamVR Settings interface as well, but accessing it via the file directly allows you to modify settings for your target devices from within a game installer, for example.
Unfortunately as of now there isn't a way to configure this on a per-app basis, meaning the behavior will be turned off for all SteamVR apps on a user's machine. Tweaking this setting comes with the caveat that low framerates make users feel sick and the fade-to-grid feature prevents this from happening. However, in my experience, the feature is a nuisance that detracts from immersion far more than a temporary dip in framerate as long as you're following performance best practices, and if framerate is dropping anyway, this fade to grid feature causes intense flickering that's just as uncomfortable as low framerate.
I have converted my working project from Unity into Unity 5 and now the stereoscopic display doesnt work.
It seems like the stereoscopic effect doesnt work. The display is split in the middle, and the shader is applied, but it seems like there is only once camera. Like there are no eye cameras.
The weirdest thing is that everything works perfectly in the editor, but when I run it on device it seems like the cameras are disabled.
I went through and tried everything in the "known issues" in Cardboard SDK Release Notes, but nothing works.
Has anyone succesfully run a Cardboard game on Unity 5?
Yes, I have done. Mine isn't big one but has major things that can be said to be using UNITY features as well. I cant predict your problem as such but Answer to this post is certainly YES.
I don't think that anyone has posted this yet, but it appears that the SDK is currently broken in Unity 5.
From: Cardboard SDK Release Notes
Unity 5 rendering issues: As of Unity build 5.0.0f4, the following steps should be taken to fix or ameliorate any rendering issues, such as an all-black screen, flashing textures, or non-stereo views:
Enable the Development Build option in the Build dialog. This seems to fix various rendering glitches, like flashing textures.
The root cause of the rendering glitches is under analysis, with assistance from Unity.
I have also found that the app has rendering issues when it initially runs when you hit "Build and Run". Closing the app from the task switcher and restarting seems to resolve the issue.
I'm planning to benchmark the graphical performance of the Unity engine on Android.
To do that I want my application to run without any fps-limits. The problem is that I have possible encountered such a limit when using the Unity engine.
I think that Unity is somehow limiting the framerate because I've been able to run native benchmarks on my device with well above 100fps whereas an empty Unity app can't get beyond 60fps.
I have already tried setting Application.targetFrameRate to -1 and setting the project-quality settings to "Fastest". Setting the quality settings to the fastest settings should have disabled VSync which in my experience often caused a 60fps limit.
Thanks in advance
i'm getting started with XNA game development and tried to run tutorail app on http://create.msdn.com/downloads/?id=753&filename=Shooter_Project_Windows.zip, but when i run, this blue window appears insted of emulator
What's wrong?
There is no way to know what is wrong for sure without more info. The blue window you are seeing indicates that the project is running; it is just not displaying anything visible to you.
If I had to guess (and it's just a guess, but it's a common issue for these types of things), the issue is possibly that your camera is facing the wrong direction. Other potential problems include things like the clip planes being set incorrectly. You might also look at the console to see if something failed without crashing the program...if a mesh or something was supposed to be loaded, and failed for some reason, you might also not see anything.