I made a script that turns a list of cubes into 1 big mesh, optimizing everywhere where possible, when i quickly came to the conclusion that it was nonsense to give each cube face each own 4 vertices.
So i modified the script and made every cube only have 8 vertices.
Then i learned about smooth shading and how unity applies it.
Appearantly any shared vertex wil have smooth shading, while i want 8vertices per cube and have them flat-shaded.
From 24 verts to 8 per cube is a HUGE difference.
And if that works with flat shading i could even make it less then 8 vertices per cube by letting cube B use vertices from A, C from B, etc.
If anyone knows how to bypass this that would help me out a lot, thanks already.
Yes it’s possible. Take a look on Github for a flat shader. And understand that you’ll be putting some extra burden on the GPU having to calculate the missing normals.
What platform are you dealing with? And how many verts in total are you talking here? Millions? Hundreds of millions? Billions? The hardware inside of your average desktop GPU that is used to processes verticies is exactly the same hardware that processes fragments and you can easily expect tens of millions of those to be handled in just a few milliseconds with relative ease.
At the moment just pc.
about 50 chunks per frame (50 * 20000 ~ around a 100k per vertices frame).
Dont forget that the cpu has to do a ot of calculations to calculate where triangles should be created and where not to.
There are for example no caves at the moment, so only the top of every chunks has faces.
That’s actually 1 million but who’s counting Rendering wise that still wouldn’t have even the slightest impact for any desktop GPU that’s less than ten maybe even fifteen years old.
I hadn’t considered the CPU side of things though. I guess I’d just assumed that the meshes would be relatively static and was only considering small changes at a time. Glad you found something that works for you.