当前位置:网站首页>How to reduce the resolution of only 3D camera but not UI camera

How to reduce the resolution of only 3D camera but not UI camera

2022-07-28 14:34:00 UWATech

1) How to only lower 3D The camera doesn't fall UI The resolution of the camera
​2)Unity Use Wwise No sound after audio packaging
3) How to realize the edge of irregular terrain area unlocked by area in the fog of war
4)PC Package Chinese path problem


This is the first 305 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 )

Rendering

Q: Project due to GPU pressure , Plan to reduce performance pressure by reducing resolution . When reducing the resolution , Is there any way to just lower 3D The camera , Not falling UI The camera ?

A1: Need to put 3D Render the scene to RT Inside , then RT As RawImage Of Texture Render to UI Inside , This can be done by controlling RT To control the rendering resolution of the scene .

thank [email protected] The Q & a community provides answers

A2: I modified this URP pipeline :URP-12-GammaUIAndSplitResolution

The main problem to be solved is : Under linear workflow , Scene camera and UI The camera adopts independent resolution , also UI Be able to stay in Gamma Work in color space ( For details, please check the project readme file ).

Thank Nightingale @UWA The Q & a community provides answers


Wwise

Q: Manual will GeneratedSoundBanks Drag files to StreamingAssets There was still no sound ,Log It doesn't show that the sound file can't be found , Ask for advice !

A:Wwise Of Bank The loading mechanism is similar to File.Open(Path), such API For Android phones StreamingAssets Catalog ( read-only JAR package ) no , You can take Banks from StreamingAssets Copy the directory to Persistent Path Inside .

Thank Nightingale @UWA The Q & a community provides answers


Rendering

Q: Here's the picture , How is this irregular area of the fog of war realized ? Unlock by area , What kind of logic is the edge of this irregular area ?

 

Unlock once N A grid area , this N Areas should be polygons Mesh, The edges should be straight , But I don't know where Shader How to calculate makes him irregular and connected , It's like making noise ?

and Mask All pixels are stored by grid , The edge of the area is straight , How to realize this irregular connection ?

A1: Divide the map into several Cell, Then unlock one at a time . As for the appearance of irregularity, some fixed random algorithms are used to display pictures , The principle is similar to the puzzle .

Thank you Xiao Xiaojun @UWA The Q & a community provides answers

A2: Draw fog plus a can Read/Write Of Mask It should also be possible to achieve .

Whether it's straight or irregular depends on your Mask The resolution of the , and Mask The value of is not zero or one , It depends on how to achieve .

Thank you Yufei @UWA The Q & a community provides answers

A3: You can refer to :《 Smooth transition of war fog ( One ) principle :Warcraft3 Terrain mosaic algorithm 》

thank [email protected] The Q & a community provides answers


Script

Q: When the game is packaged, the installation directory is Chinese ,PC What method do you usually use to solve the Chinese path of the package ?

A: General situation C# Is to use Unicode, The file reading method provided by the library should support Chinese . however , Like some C Library for file reading ( For example, you may encounter direct passage lua_loadfile Of this kind of interface ), Need to use WindowsAPI:WideCharToMultiByte hold Unicode After converting to a multi byte string that the system can recognize , Then it is transmitted to the interface that needs to read the file .

thank [email protected] The Q & a community provides answers

The cover image comes from 《URP From principle to application —— Advanced 》


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 )

原网站

版权声明
本文为[UWATech]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/209/202207281338318426.html