Does Unity3D supports different pixel densities like native android? - unity3d

Native android supports different pixel densities like ldpi, mdpi, hdpi, xhdpi, xxhdpi and so on. This feature balances app quality and app size.
Currently I'm facing this issue in Unity mobile games (iOS & android) when I use,
high quality graphics it increases crashes and lagging in low-end devices.
low quality graphics it looks blurry and pixelated in high-end devices like iPad Pro etc.
I can use 2 different quality images but again it increases app size as the low-end devices end up downloading the HD images too.
How to solve this issue?

I suggest looking at the Unity Addressables system available in Unity 2020 LTS and beyond. This is a whole new tool that you'll have to investigate so I cannot provide a quick class or line of code to solve your problem. However, the Unity Addressables system is available in the Package Manager with docs available here.
Using this system will likely make it easier to run hi-res assets on lower-end devices. Since assets are streamed in when needed your texture memory is going to be significantly reduced as textures are unloaded as soon as you're done with them.
Addressables can also be used to load in assets remotely which would reduce your total file size. However, depending on how far you are in development this could be a big change.
You may also want to look at splitting the application binary if changing over to Addressables is too much work. If you split the binary, you can reduce the initial download of the application and have users opt-in to hi-res textures. There are a variety of other solutions provided by the Unity docs on Android builds here.
Good luck on getting your game to a shipped state!

Related

Which server/webframework is better to use on an embedded device with limited resources

I wanted to know which server/web framework I should go for. I'm developing an application that would run on IoT-styled cameras and/or small embedded boards(like Nvidia Jetson boards). After getting the feed from the camera, I'll do some postprocessing and then I want to transfer the data directly to the browser.
Some things to consider,
The main focus is on the local network since I'll be setting fixed local IPs for the cameras but may want to extend this in the future.
The numbers of clients would be small, typically around the 1-10 range.
Server will be low on ram and space
Camera can capture 5k images and I want to be able to transfer them with minimal fps drop. Currently, the fps for 5k images is approx 10 but it may increase in future.
The code base is in c++ so something compatible with it would be favoured.
I tried flask(even tho it is in python) and it worked great for lower resolution capture but there was a significant drop with higher resolutions.
Also, should I go with something like RTSP, RTMP or webRTC kind of thing? In an initial test with RTSP, I saw a drop in fps as well as an image quality drop.

How to reduce memory usage of dynamically loaded Textures in Unity?

Overview:
Currently working on a project in Unity for iOS and Android, where at runtime we download and store images in PNG format for later use. When we need to we load these textures as well as some from a web server using Unity's WebRequestTexture and both file:// and https:// schemes respectively.
Problem:
The problem we are facing is that when we use the WebRequestTexture method the memory usage of the textures increases significantly.
Question:
Is there a way to potentially pre-compress the locally downloaded images into device compatible compressed formats, and then load them directly to the GPU without it increasing the memory size required?
If this is possible would using Texture2D.CreateExternalTexture allow us to then use these textures without further increasing the memory usage?

LoadRawTextureData vs LoadImage

I am trying to understand the expected performance difference in speed, and RAM&GPU consumption of these two in Unity. Or is it limited to LoadRawTextureData works with compressed textures whist LoadImage can't.
I was asked and I'm developing on iOS, iPadOS, Android and WebGL but I'm looking for a general answer to help me research each further later.
The use case is a user uploading multiple high-res images to the server, and then a mobile client downloading these back again.

How to reduce the android build size in unity 2017 p3

I am currently using Unity 2013 p3. The problem is, when I build my project in android, the app apk size is about 29mb. And the installed app size in android is about 76mb.
Once the size was very huge, but after searching unity forums, as mentioned here, I altered the configuration settings under Project setting -> player, and changed the device filter to ARMv7. The size has been considerably reduced then. It resulted in the above mentioned metrics which is yet too large.
I tried reducing the size by compressing images that are used in the project, by using the image compression option available in unity as mentioned here. The apk size is reduced somewhat, but the image quality became low comparatively.
Now I don't know any other way to reduce app size without affecting the quality. Can anyone help me with this issue?? Thanks in advance :)
You should use compressed sounds, low poly models, set image quality to normal. Don't use unnecessary references to prefabs. Hope this will work for you!

How to Play High Quality Video in Unity

I'm using MovieTexture now, but when a video file is added to unity Project, it will automatically be imported and converted to Ogg Theora format. and the quality is really bad.
I have tried changing the quality setting and even on the highest setting the video is still pretty bad quality, I have tried it in multiple file formats like .mov, .avi. .mpeg4 etc. I have even tried converting it to .ogv to try and get around unity converting it itself, and still the quality is poor. The platform is PC, and in the build the quality is the same as in the editor.
so the question is ,how to play high quality video in unity no matter using MovieTexture or anything else like some plugins?
Unity player on Windows only supports OGG, which is why Unity is transcoding your videos.
I have use the Renderheads AVPRo Quicktime plugin on Windows to play very high quality videos in kiosk setups. (They also have one for Windows Media format, but I used Quicktime).
Link: Renderheads AVPro (Quicktime)
I am not affiliated with them in any way, just a very happy customer, and here is the review I posted on the Unity Asset store:
Great work on your plugin! I've used so many plugins that don't work well over multiple platforms, or require switching between platforms, or manual steps, or manual licensing, or DLL hell, etc. I have to say you nailed it.
I develop on a Mac (and your plugin runs in the Unity Editor), then deploying on Windows. It all worked well straight forward and as documented. Even the events to detect when a video has loaded and is ready to play just what I needed (as we are loading a large video file).
Additionally, the error messages are very precise and pin-point a problem (missing file, bad format, etc) which means less time debugging.