- Home /
1 million verts and 0.5million tris in Low-poly WebGL game
Just as topic says - low poly WebGL game has 0.8-1 million verts and half this tris. Models aren't detail at all. Why is that?
I don't quite understand the question. Why do you have 1million verts in the stats display? Because that's how many are being rendered on the screen.
Did you create these models? How many verts/tris do you think they should contain? Please post a screenshot of the scene view in wireframe mode so we can see how the models are structured.
Also, is that a terrain component that I see just cropped off the right hand side of your image? That will go some way to explaining the vert/tri count...
This is wireframe mode: I$$anonymous$$AGE versus normal mode: I$$anonymous$$AGE
I didn't create these models, I took them from Unity Assets Store for free.
I think the number of verts/tris is just insane, I tried to optimize the game as much as I could but integrated GPUs can still hardly handle it.. It is very sad keeping in $$anonymous$$d that models are low poly
Yes, I use terrain and I also use lower/higher tool as well as brushes to change texture of my path.
The models seem ok (you can select each mesh individually in the inspector and count the verts/tris there) but there's obviously something not right in the scene. What happens to the counts if you disable the terrain?
That's low poly buddy... not sure what you're expecting, but high poly is like 100k-250k verts per model.
The portion of the scene shown in the screenshot could be modelled using a couple of hundred verts.... i.e. a thousand times less than that.
I did NOT see that scene, jesus christ those should be 60 vert models. I'm assu$$anonymous$$g he did not model them himself, but whoever did needs a bit of a whoopin lol. $$anonymous$$y average low poly model is around 380 verts, but thats with rounded edges...
How many lights / shadows are you doing? Do me a solid and go to any lights in the scene and turn off shadows...
I only use 1 directional light. I tried to turn off shadows, but not much have changed apart that shadows are now gone! Could this noticeably help to improve performance when exported to WebGL?
@Doublemax>> There are couple of hundred objects: I$$anonymous$$AGE
1.7million verts!! WHAT?! There's nothing that could possible have that much vertex in this I$$anonymous$$AGE: URL
Far Clipping Plane is downgraded from 200 to 110.
Your batch count is enormous too - there's definitely something not right. What shader are you using on the material(s)? How many passes does it have? Do you have any pixel lights in the scene (point/spot)?
I mostly use Standard shader. There are few objects that uses Standard Specular and I also use GUI/3D Text shader for my post signs text, here is the shader: http://wiki.unity3d.com/index.php?title=3DText. I DON'T have any pixel lights in the scene, I only use one directional light. How many tris/verts am I suppose to get here approximately? It's usually 0.4-0.55 million but there are two places where it goes up to 1-1.7 million and I can't figure it out. $$anonymous$$aybe its those 3D text shaders? But nothing changes when I remove them.
EDIT: I also use standard assets' water4simple with FX/Water shader which generates these objects: I$$anonymous$$AGE Removing these components haven't change anything.
I would suggest - create an empty scene and start adding assets one by one, so you can check the verts count reported by Unity against the expected one, counted manually. If there are any issues with any particular asset, you should spot them immediately.
Answer by JuliuszK · Jan 11, 2017 at 03:42 PM
What is misleading about these low-poly models is that they have sharp edges. This means that vertices have to be split, so they don't share normals. A smooth box has only 8 vertices, but a flat box has 24 (6 x 4). At least that's how people do it most of the time. If this is the reason of your high verts count, try thinking about using the flat shading solution instead. Look at this article: - maybe it will be of a help to you.
Right, also the scene seems to be quite large with quite a lot objects in it. It's just simple math. For example if you look at the wireframe image one of these small bushes look like it can easily have about 50 verts. On the portion of the scene that we see there are at least 20 of them. So there are most likely about 100-200 (or even more) of these in the scene. That's 5k - 10k+ vertices.
The roof of one house is made up of about "6 steps" each side that means about 24 quads for the roof. Now if those quads use 2 shared vertices each the roof would have 24*4 == 96 vertices. If it doesn't use shared vertices the 24 quads would split into 48 seperate triangles so 48*3 == 144 vertices.
One tree has at least 60 triangles so about 180+ verts if you have 1000 trees in your scene those alone would be 180k verts. $$anonymous$$eep in $$anonymous$$d that 1000 sounds like a lot but isn't that much in a 2d space. If you fill a rectangular space with 25 x 40 trees that's already 1000 trees.
Due to the perspective the OP has choosen for the wireframe shot it's hard to tell how many objects there actually are. But the area behind the right house is almost completely black so there has to be quite a lot of objects. If we assume an average vert count of 150 per object we would have about 6k objects in the scene to get to 1$$anonymous$$.
In some edge-case scenarios even $$anonymous$$inecraft can easily have up to 25$$anonymous$$+ vertices. And that's only the visible terrain without any entities.
Answer by Hoqq · Jan 12, 2017 at 06:11 PM
Realtime shadows at a minimum double your vert count, most likely more depending on how many lights/shadows you have and the shadow draw distance.
Also the point made about flat shading is very true. A flat-shaded box has many more vertices than a smooth shaded one in order to make edges look sharp.
Thank you for your comment. I have only one directional light and I set shadow draw distance to 30. I'm now using occlusion culling which helps a little bit to lower vert count. Although, there are this one spot in the beginning where I see 1.2million verts and there is no reason for that, especially if im standing behind the building which should cover other objects.
OH, you also mentioned 3D text which might be the culprit. I've imported in 3D text from blender before and they usually have a high subdivision level to make them look rounded, so try disabling them.
Thanks, but I tried to delete all the text using GUI/3D text shader and it didn't help. So it must be something else!
Answer by tanoshimi · Jan 13, 2017 at 10:34 AM
You said earlier that you only had one camera in the scene, and then posted this screenshot of your hierarchy:
Note that the verts/tris count in the Stats window shows the number of elements drawn, not the number in the scene. Assuming that at least some of those objects with "Camera" in their name have got active camera components attached, you're probably rendering the same verts/tris many, many times over.
Many of them camera objects seem duplicates anyway - what are they all meant to do?! Disable all cameras in the scene except one and I bet your stats will reduce to a fraction of their current levels.
Thanks for your reply. I'm not using these cameras and I've no idea what they do. They appeared after I used water4simple object. And these cameras come up again if I try to delete them. If I remove water objects and delete these cameras not much changes. I turned off all image effects that I had added to my main camera object. I think verts number doesn't even reach 0.8million, so it's good.
Your answer
Follow this Question
Related Questions
Computer starts heating up when I enable my props 2 Answers
Average number of tris in tower defense? 0 Answers
Gtx 860m power in one scene 1 Answer