当前位置:网站首页>Will the memory of ParticleSystem be affected by maxparticles
Will the memory of ParticleSystem be affected by maxparticles
2022-07-04 01:40:00 【UWATech】
1)ParticleSystem Your memory will be affected MaxParticles Influence
2) Use the code to modify the image compression format and report an error
3)Unity Texture import settings have an impact on memory
4)Unity Solution for video playback in
This is the first 285 piece UWA Push of technical knowledge sharing . Today we continue to select and develop a number of 、 Optimization related issues , Suggested reading time 10 minute , If you read it carefully, you will get something .
UWA Question answering community :answer.uwa4d.com
UWA QQ Group 2:793972859( The original group is full )
Memory
Q:ParticleSystem Your memory will be affected MaxParticles Does the value set affect ?
A: Did a test on the real machine ,Unity 2020.3.17, millet 9. The special effect of the test is Unity default ParticleSystem Special effects , give the result as follows :
As you can see from the picture above , Memory is affected by “ The actual maximum number of particles ” Influence ,( It can be roughly understood as duration * Number of launches per second , Don't consider Burst How to launch ). When the number of launches is 0 when ,ParticleSystem There is a 9416Byte Memory footprint , This is Unity Occupation of built-in serialized things .
in addition , When “ The actual maximum number of particles ” after ,Active The number of particles increases with playing time , Memory usage will not change , As shown in the figure below .
PS:
When ParticleSystem What was launched was Mesh when , Can cause Gfx Memory up , And this Mesh Memory usage is not counted Assets/Mesh In memory usage .
thank [email protected] The Q & a community provides answers
Texture
Q: When you want to add a picture , Automatic processing of picture settings , As a result, the setting of the picture times is wrong , There is no solution on the Internet , Error is as follows :Selected texture format ‘Unsupported’ for platform ‘Android’ is not valid with the current texture type ‘Sprite’.
Unity edition :2019.4.34f1
public class TextureImporterProcessor : AssetPostprocessor { void OnPostprocessTexture(Texture2D texture) { bool haveAlpha = textureImporter.DoesSourceTextureHaveAlpha(); textureImporter.isReadable = false; textureImporter.mipmapEnabled = false; textureImporter.alphaIsTransparency = haveAlpha; textureImporter.textureType = TextureImporterType.Sprite; textureImporter.textureCompression = TextureImporterCompression.Compressed; TextureImporterPlatformSettings androidSettings = new TextureImporterPlatformSettings() { name = "Android", overridden = true, format = haveAlpha ? TextureImporterFormat.ASTC_RGBA_6x6 : TextureImporterFormat.ASTC_RGB_6x6, }; textureImporter.SetPlatformTextureSettings(androidSettings); TextureImporterPlatformSettings iOSSetting = new TextureImporterPlatformSettings() { name = "iPhone", overridden = true, format = haveAlpha ? TextureImporterFormat.ASTC_RGBA_6x6 : TextureImporterFormat.ASTC_RGB_6x6, }; textureImporter.SetPlatformTextureSettings(iOSSetting); textureImporter.SaveAndReimport(); } }
A1: It may be the problem of texture format , I'll put ASTC_RGBA_6x6 Change to ASTC_6x6 There is no such error report .
Thank you Zong Huixuan @UWA The Q & a community provides answers
A2: Add upstairs ,TextureImporterFormat There is a problem with the format specification ,ASTC Integrated with A The format of , So the code is unified into ASTC_x 了 . In the new 2020 There is no more in the version ASTC_RGBA And ASTC_RGB The distinction between , All unified into one interface ASTC_x In the , It should be the problem of version transition ,Unity 2019 There are many transition problems , stay 2020 It's much better up there .
Thanks to Liao Wuxing @UWA The Q & a community provides answers
Texture
Q: a sheet 2048x2048 But the actual pixels are only 512x512, And a 512x512 What's the difference between your pictures ? We're making a system like a paper doll , Want to set a standard . Currently scheduled 512x512 The size of the ( For scalability ). But most dress up sizes may actually be only 250x250, Want to know if there is actually a difference between loading and memory ?
A1: Experimental data , The size of the same picture is 1024 Graph , The project settings are as follows , Compare the results :
The above test data are in PC Test data under . Data on the phone , The landlord can test it by himself . In the early stage, we can consider using 512 Make the original drawing according to the size of , Then make a tool , Select the compression size you need when sending out the package .
Thanks to Liao Wuxing @UWA The Q & a community provides answers
A2: Continue to answer upstairs .
After the texture is loaded into memory, the calculation formula of memory occupation is :
Texture memory ( byte ) = wide x high x Pixel byte
Pixel byte = Number of pixel channels (R/G/B/A) x Channel size
in other words : Runtime size = Long x wide x The size of each pixel
give an example :RGBA 8888 It represents the channel RGBA Each channel occupies 8bit So one pixel takes up 4bytes. so , If the picture size is 1024x1024, Then size =1024x1024x4/1024/1024 = 4MB.
In the example upstairs ASTC 4x4 block Compressed format .
ASTC 4x4 block Compressed format , Each pixel occupies 1 byte ,8bits. a sheet 1024x1024 The compressed size of the map is 1MB.
Thank you, Ma San @UWA The Q & a community provides answers
Video
Q: Need to play video in the game , Meet some basic needs , For example, play remote video , Broadcast as you go down , Set the video playback speed , Video progress bar , Pause or something .
Currently known, you can use your own Video Player、AVPro and Sofdec2 These three paragraphs , I'd like to ask if there is any big guy system that has studied video playback , Can share a little experience , Thank you for .
A: On the three video methods mentioned in the title , I used Video Player and AVPro.
In ordinary use Video Player Has been able to meet most of the needs , But in terms of video compatibility , And platform applicability ,AVPro than Video Player Much better , and Video Player You also need to encapsulate some interfaces to facilitate your use .
Video Player There are some specific required formats on each platform , Therefore, we should also control our own compatibility , And probably in Android On the platform , Some videos will cause some inexplicable black screens . Its advantage lies in its lightness , No need for too much Integration , Good compatibility with the engine , Upgrading the engine will not cause the trouble of inconsistent versions .
AVPro Some of the disadvantages of are more functions , For some unnecessary functions , Will be more bloated , It's not as compatible with the engine Video Player. The advantages are obvious , The function is still very powerful , And it has a good performance in the compatibility of the platform . There are some fixed decoding algorithms , stay Android The performance on the platform is the most obvious .
Many things are double-edged . Look at your needs , No best , Only the most suitable . If you have something, you must give it up , Give and take . You should be specific to your needs and the limitations of the current project , Think about what suits you .
Thanks to Liao Wuxing @UWA The Q & a community provides answers
The cover image comes from :GPU Particles Unity
be used for Unity Of GPU particle system .
Today's sharing is here . Of course , There is no end to life but to know . In the long development cycle , The problems you see may be just the tip of the iceberg , We are already in UWA The Q & a website has more technical topics waiting for you to explore and share together . You are welcome to join us , Maybe your method can solve other people's urgent needs ; And he's a mountain “ stone ”, Can also attack you “ jade ”.
Official website :www.uwa4d.com
Official technology blog :blog.uwa4d.com
Official Q & a community :answer.uwa4d.com
UWA School :edu.uwa4d.com
Official technology QQ Group :793972859( The original group is full )
边栏推荐
- How to delete MySQL components using xshell7?
- The latest analysis of hoisting machinery command in 2022 and free examination questions of hoisting machinery command
- Decompile and modify the non source exe or DLL with dnspy
- All ceramic crowns - current market situation and future development trend
- Is Shengang securities company as safe as other securities companies
- Openbionics robot project introduction | bciduino community finishing
- How to view the computing power of GPU?
- Meta metauniverse female safety problems occur frequently. How to solve the related problems in the metauniverse?
- Small program graduation project based on wechat e-book small program graduation project opening report function reference
- Solution to the problem that jsp language cannot be recognized in idea
猜你喜欢
Applet graduation project is based on wechat classroom laboratory reservation applet graduation project opening report function reference
Rearrangement of tag number of cadence OrCAD components and sequence number of schematic page
Ka! Why does the seat belt suddenly fail to pull? After reading these pictures, I can't stop wearing them
Jerry's modification setting status [chapter]
Query efficiency increased by 10 times! Three optimization schemes to help you solve the deep paging problem of MySQL
AI helps make new breakthroughs in art design plagiarism retrieval! Professor Liu Fang's team paper was employed by ACM mm, a multimedia top-level conference
Applet graduation project based on wechat selection voting applet graduation project opening report function reference
HackTheBox-baby breaking grad
Remember a lazy query error
SQL statement
随机推荐
Jerry's watch listens to the message notification of the target third-party software and pushes the message to the device [article]
Huawei BFD and NQA
All in one 1412: binary classification
Applet graduation project is based on wechat classroom laboratory reservation applet graduation project opening report function reference
Pesticide synergist - current market situation and future development trend
Huawei rip and BFD linkage
2022 R2 mobile pressure vessel filling certificate examination and R2 mobile pressure vessel filling simulation examination questions
Query efficiency increased by 10 times! Three optimization schemes to help you solve the deep paging problem of MySQL
The contact data on Jerry's management device supports reading and updating operations [articles]
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
Long article review: entropy, free energy, symmetry and dynamics in the brain
SQL statement
Typescript basic knowledge sorting
Pyrethroid pesticide intermediates - market status and future development trend
Jerry's watch information type table [chapter]
[typora installation package] old typera installation package, free version
2020-12-02 SSM advanced integration Shang Silicon Valley
Meta metauniverse female safety problems occur frequently, how to solve the relevant problems in the metauniverse?
Audio resource settings for U3D resource management
C import Xls data method summary II (save the uploaded file to the DataTable instance object)