- Home /
Model with a small amount of polygons causes lags
Hello, I would like to ask someone to see the model and check what can cause fps declines when the model appears in front of the camera. There are two models because this is articulated bus, in total, these two models have about 450 polygons. There is a slight drop in fps on the android when the model is visible, you can not see anything special in the profiler, camera render raising only a few percent. Model is made in google sketchup, not by me. I tried to import as in the tutorials. Can it be a transparent texture on the windows? Please just check the model. MODEL DOWNLOAD
What type of material do you use on the model? If the model is not too complicated, then it is probably the shader that causes issues. Also, what other scripts are on the objects? $$anonymous$$aybe those are causing the performance drop.
Answer by Bunny83 · Apr 12, 2018 at 09:54 AM
I have no idea where you got your number 450 from. Here are only the first model stats:
// PartName Verts Tris submesh Count T_Vert T_Tris
// -------------------------------------------------------------
// Bus Body 1068 921 7 x1 1068 921
// Door 152 268 4 x4 608 1072
// Wheel 130 150 2 x4 520 600
// Lower Body 130 80 2 x1 130 80
// Wheel cover 36 20 2 x4 144 80
// connector 96 52 1 x1 96 52
// driverwindow 88 132 3 x1 88 132
// SideWindow 96 148 3 x9 864 1332
// BrakeLight 40 20 2 x4 160 80
// ---------------------------------------------------------------
// 3678 4349
Since all materials by default uses the Standard shader you get several batches for each part due to lights, shadows, ... The whole model issues 102 batches with the standard shader. The vertex count of each subpart is too high for dynamical batching. The model uses 11 materials. When the model is statically batched we get 44 batches (4 x 11). Though static batching is only an option if the model does not move and have no moving parts.
To sum up: This is a very bad model for a game. It uses not a single texture but only solid color materials. The optimal case would be two materials (1 opaque, 1 transparent) and each with a single texture. Though this model has way too much detail in the geometry which could have been drawn on the texture / normalmap. Only the 9 side windows have 864 vertices and 1332 triangles which is more than the whole body. The wheels also have way too much geometric detail.
When a texture would have been used a single wheel (with 12 steps) would only need 48 vertices and 44 triangles. Also if the poly count becomes a problem the inner face of the wheel could be cut out (which would mean -10 triangles -12 vertices)
This is a very bad model for use on mobile devices.
Thank you for your answer, you are right. About polygons, I took number from there: LIN$$anonymous$$ I will rework the whole model and I will have to watch tutorials about texturing.
Answer by filibis · Apr 12, 2018 at 12:00 PM
The busses are poorly designed. The problem you encounter is mostly because the model has a lot of backfaces and leaks (not water tight) appears around geometry. Take a look at the model i edited and compare it with the original (and test if it improves performance in Unity). It still might cause problems, because you can see backfaces from windows. So bus structure and doors should have a thickness in that case.
Thank you! Yes, I think it is better.
So bus structure and doors should have a thickness in that case.
Do you mean that it can't be flat with visible faces from every side but interior should be modeled separatly? Walls, doors have thickness with empty space inside and faces inside should be invisible right?
I didn't really understand your question.
In a nutshell: Everything your eye/camera sees must be front face (white color by default in SketchUp).
In this case, bus body, doors & windows have 0 thickness, thus we see 'inside of mesh' (backfaces) from windows which is not desirable. You need to increase thickness of the model. JPP plugin might come in handy for the process.
Example:
Thank you, you explained very well, the plugin will be very useful
Your answer
Follow this Question
Related Questions
Transform component does not line up with model 2 Answers
Google Sketchup models appearing badly 2 Answers
Incorrect point light act on imported .fbx model (sketchup) 4 Answers
Import Model Question (.obj Sketchup) 0 Answers
Google Sketchup FXB or DAE 3D Model Not Importing Correctly into Unity 1 Answer