I have been looking at my scene again and I immediately noticed a few obvious flaws, which keep my environment from running smoothly.
High amount of polygons: most of the meshes are still in blockout phase, which provides them with an unnecessary amount of polygons.
The hierarchy is a complete mess: this can be a factor of influence for the piling up of unnecessary files.
The project folder is a complete mess: while building the scene, I lost the overview of the amount of file duplicates, after a while. There is also a package that I ended up not using anymore, Aura II. This one could very well be deleted. HDRP does not work with it anyway.
The scene contains over 300 K polygons. Especially the rocks need a good cleanup. They are also lacking a convincing shape... they come across very cartoony, round and dull.
On the left in the Hierarchy are only a few of the group files fold out. Some objets are even grayed-out. Those were stored to serve as animation event tools and I only used them if I had to record an animation.
As you can see the material folder is a dump pile of files with the same name. This happened because I have reimported some of the assets many times, which reimported the materials as well. I tried to throw a few away, but that ended up in one pink mesh drama.
It is very clear what I have to do first.
Retoplogize the meshes.
Rebuild my scene in a new project to get an overview of the things I really need and use.
Analyses Profiler Tools
Profiler
Frame debugger
Render Pipeline Debug
Lighting Explorer
all lights in the scene together
Project Settings
Graphics
Layers
Quality
Tags & Layers
Project Hierarchy
Is there an order? Too many objects?
How many lights are static and dynamic?
Project folder
materials observation (transparency, alpha clipping, how many textures)
object observation (imported settings)
My FPS jumps around 69 in game.
Why are there 814 textures in my memory storage? I imported around 5 image textures. The material quantity is embarrassing: 192.
50 draw calls. Not that much.
What are does high peeks at some points? Are those effecting the performance or due to the lack of performance?
Why is the lanternpost the only object with a lightmap? What does having a lightmap even mean?
I guess red is low performance and blue is high? According to the WAU monster having 3 types of shaders and 2 dynamic lights shining on it
Emissive parts in my scene.
I did some small research on mipmaps since I was confused when observing the Render Pipeline Debug. I looked at the false color mode, freeze camera for culling, the NanTracker (which had a horrible result in FPS peformance). Mipmaps got my intension... since my environment is big and can get some help with LOD and mipmaps for instance.
Definition Mipmaps:
Mipmaps are lists of progressively smaller versions of an image, used to optimise performance on real-time 3D engines. Objects that are far away from the Camera use smaller Texture versions. Using mipmaps uses 33% more memory, but not using them can result in a huge performance loss.
I have a huge amount of lights which are not baked, I pressume.
Not observing something special.
Models scatered throughout folders, but not a huge unnecessary amount of models in general.
Way too many copies of materials. But having this many materials with solid colors is, I guess, less bad than having this many materials with textures? Everywhere I searched I noticed people saying that textures suck up more performance than solid colors. If I still end up with lots and lots of materials at the end maybe Atlassing all of these solid colors into one UV could be a problem solving ability. One Atlas UV for the station and one for the rest?
Shading in Maya:
https://courses.cs.washington.edu/courses/cse458/05au/help/mayaguide/Complete/Shading.pdf
Some shaders like "CablesL", "CablesM" and "CablesR" and duplicates with a slightly different element to create randomness. But this can be done within one shader much easier and more efficient.
My teacher forwarded me a link to a video that plays around with the random note in the Shader Graph:
https://www.youtube.com/watch?v=firdoL0pjiI
In stead of letting some dynamic lamps flicker with animations and creating a performance heavy result, I already happened to make some optimization by letting some lamps flicker with a shader. This does not project any light on its surroundings but for lamps in the distance this not a problem. See the gif below.
- The lamp on the top is a dynamic lamp with animation
- The lamps on the left and right are flickering through shaders, they do
not have a light source.
Due to a lot of trial and error in the last two phases I lost the overview of what I do and eventually did not use anymore. So I have been digging around in the project and scene and found out which textures I use and do not use and where they are implemented. From all the textures that are placed in this project folder I implemented 7 in the actual scene. See the images below for an explanation of some of them.
Some textures I use, for instance with the dust particles, are textures grabbed from the Standard Asset pack.
texture 5. the tentacle shader uses one texture and that determines the areas where the energy is shown (only a small white line and the rest results in no input).
texture 1 & 6. the WAU body uses texture 1 and 6 inside the shader: the last texture is pure meant as the striped texture of the monster and first texture with black and white areas is responsible for the shifting light area over time.
texture 1. the star around the body of the WAU also has a shader, but it only includes the black and white texture. The pattern on the star is generated inside the shader itself with the use of Voroni and Gradient Noise (see the picture above), which again is much more efficient.
texture ? this texture is from the Standard Assets folder and works extremely well, because it has so many color values, which resulted in the distortion effect.
texture 7. I found this texture on the internet when I was searching for clouds like particles. It is used for the overall fog spread around almost the entire scene.
The folder that have a colored dot at the end are installed packs.
- On the top we have Aura, which was a pain it install and use. I installed it at first because it could give me the opportunity to add some volumentric lighting,
since I was still using the LWRP which does contain volumentrics. At the end I switched to the HDRP render pipeline because I wanted to create fancier
shaders with the PBR graph and it contains way better volumentric lighting. So I do not need Aura anymore at all.
- Then we have the Editor which holds a code that I found for better and quicker replacing prefabs and assets. Very handy, but a little bit buggy.
- The ExplosiveRealFree pack contains the texture sheet for the fog.
- The Shaders folder is not a pack I downloaded. I guess it was automaticly installed after I added the PBR shader graphs from the Package Manager.
- The Standard Assets folder takes up some memory and space, but is a very handy package to have since it also consists of some ready to use First and Third
person characters. I use one of the First Person character controllers to walk through my scene. Also a few textures I use are grabbed from this folder.
Looking at the settings of the materials in the inspector I do not notice something extreme or odd.
Some of the lamps in the scene like the lantern post for example, are containing 1 emissive material which glows and 1 spot light with volumentrics turned on. Maybe that is bad... but it works! I did figure that most of my lamps are not set as static, which is very heavy for the performance.
I used lots of different materials and shaders for the station, to get some subtile variation.
Can I bake animated light?
I suppose there is a lot to optimize inside the heavy loaded post processing options I used, but I do not want to. There are a bunch of other things I can focus on and the resulting effect of the post processing in my scene is mainly why it works so well. My scene is an deep underwater environment which is depended on sight limitations. The whole immersion would be messed up if I shift this around too much.
During my feedback moment I asked my teacher some burning questions that popped up after analysing the scene.
What are those 814 textures inside my Memory Debugger?
- Unitys weird way of storing cache files and other stuff. Not a point of interest, since I can hardly influence this process.
Can I bake animated lights?
- No, all of the lights which I provided with an animation are dynamic and could not be baked, since the light scope and intensity are changing all the time.
Why is the lanternpost the only object with a lightmap? What does having a lightmap even mean?
- It means baked lighting. The lanternpost is set as an static object and is therefore the only object with baked lighting.
50 Draw Calls
Around 69 FPS
1 static object, rest dynamic
1 baked lightmap
0 static light sources
192 materials
20 PBR shaders
300 K polygons
Not everything I discussed above is going to make a big difference in performance when optimized correctly. For instance I do not think that the many materials are a huge problem, since they are just flat colors. Atlassing could be a thing to do if there is still a performance lack at the end of the optimization process, but I doubt that will happen Also the quantity of shaders is not that bad. I asked my teacher if I had too much shaders, and he said: no. But he did say that I have some unnecessary duplicates, which I know. I think by using the random note from the tutorial I forwarded, it can maybe help with the performance, but it will mostly make my work cleaner.
There are lots of thing I can do to make my scene better and prettier but not all of them are having priority.
The things I believe are the biggest bottlenecks are comming from the huge amount of lights, which are all dynamic and therefore are not baked.
Since my scene is pretty big I also think Occlusion Culling can maybe make a big difference in performance issues. If I want that to work I have to go back to Maya, cut all of the rocks loose en export them together in one group, in stead of in one combined mesh.
Since I failed at baking the light last time I tried, I want to dive into the depth and experiment again. I never succeeded in baking lights so there is a challenge for me. I heard Unity is not the best engine for baking, but I still want to try. If this process turns out to run smoothly and fast, I want to move onto trying out Occlusion Culling, but that has no priority. The most important part is to experiment with light baking and cleaning up the mess in my scene (hierarchy and folders) to get a better overview of what I am actually using in the end.
Export all rocks in one group, not combined in one mesh.
Duplicate of scene and throw everything away exept Post Processing and lights.
Import assets and materials again and place it clean and ordered in the hierarchy.
Use the random note inside some of the shaders.
Make all non-animated lights static.
Baking the static lights.
Texture info https://docs.unity3d.com/540/Documentation/Manual/class-TextureImporter.html
Random note shader https://www.youtube.com/watch?v=firdoL0pjiI
Tech Art course platform https://sites.google.com/hotmail.com/hku-gar2-techart/knowledge
Maya Shading document https://courses.cs.washington.edu/courses/cse458/05au/help/mayaguide/Complete/Shading.pdf
Jargon from Tech Art course (dutch) https://docs.google.com/document/d/1RNdP4TiKllAquR4f7YiyzA5HcRuYTsDCR0yV6H3LMFU/edit?usp=sharing