I’m trying to get this corn plant below 256 vertices. In blender, it has 199 vertices, but when Unity imports it, it has 330. I understand why, it’s because of this:
So, other than just drastically reducing the mesh quality, does anyone have any tips, tricks or magic that maybe I’m missing?
I like that the stalk has 6 sides, it gives a nice smooth stalk. I also like that each leaf has 3 bends along each leaf. I already reduced the leaves and flower stalks as much as I can, by joining their stems inside the stalk into one vertex per group. I could probably shave a few polys off the corn, I suppose. But I don’t see anything that is going to get me below that magic vertex count other than chopping stuff off.
One thing that really bothers me (a lot) is that each leaf for all of my plants takes double the vertex count (has to be double sided), because shadows and proper shading require it. So, I thought I was smart by offsetting the vertices down the middle of each leaf, thinking that the vertices along the edges would be shared and that each leaf would take 18 vertices instead of a whopping 28. But…well, the link I posted above pretty much explains why that is a no go. Rrrrrrrr.
The only thing I can think of to do now is reduce the poly count of the leaves. I really didn’t want to have to do that.
Hi JC. I took a look at your file -imported the .obj into Blender then saved it out as an .fbx file then loaded that .fbx file into Unity.
First step in saving verts - Under “Tangents and Normals” set both to “Import”. Reduces the vert count from 340 to 300. No idea what impact this has on rendering time though.
Second step - look at the corn ears. I created a couple of different ears one with 13 verts and one with 19. Imported them into Unity as above (Normals and Tangents set to import not calculate). Also imported just one ear of your original corn the same way. See image for comparison in Unity. the UV maps of my two ears done by Unwrap->Project from View
I have also include a zip file containg my .blend file. Open it with Blender 2.63 or greater and tweak as you wish. If you use the corn ear with 13 verts - another potential saving of 30 verts.
There are six big leaves - each with 4 “bends”. reducing the number of bends on a leaf from 4 to 3 will save 4 verts for each one you remove.So doing that to four of the leaves saves you 16 verts - total saving 40+30+12 = 82 verts. Or your ripe corn stalk is now 258 verts.
With vegetation especially, a shader that handle one sided polygons for leaves and such, with proper lighting, would save a TON of vertices and allow a lot more detail.
I have heard whispers of such a thing existing on the interweb, but have not found proof
.
Double Sided Diffuse – Just double sided textured material
Double Sided Bumped – Adds a normal map channel to the above
Double Sided Bumped Specular – A double sided bumped material with Specular from the Alpha channel
Double Sided Specular – Double sided material with specular, no bumps.
It’s always going to be faster if you batch these yourself as opposed to using dynamic batching (if that’s your goal). If they absolutely need to be dynamic there’s other tricks you can do, such as using DrawMesh.
Yes, I actually am batching these into mesh patches. I just want to get as much vegetation as is possible with as small a vertex count as possible. It’s amazing how fast they add up.
Anything cylindrical needs only three sides and a single smoothing group to appear as a smooth cylinder. Your stalks are cylinders filed to a point so you can get rid of half of the verts in the stalk right there.
A smoothing group? I’ve never heard of that, I apply Vertex smoothing (vs flat) is that the same thing?
I have some meshes that have a tube shape, with 4 vertices. It does appear smooth…until shadows hit it, and then you see the sharp edges.
I’ll look into smoothing groups though, thanks!
Edit: Just found this:
How interesting, thank you very much for mentioning this!