- Home /
Can I use bytes instead of floats for vertices?
When creating a procedural mesh, the vertex coordinates never have values even close to 255.
My meshes have a LOT of vertices. With each element consuming a float, this takes up a lot of memory. Is there any way to specify a byte data type for vertices instead of floats, like with DX and OpenGL?
Answer by Eric5h5 · Feb 10, 2011 at 11:35 PM
No, Unity uses floats only. Whether the coordinates are close to 255 doesn't matter anyway, since you need floats for values like 1.105 and so on. For imported meshes, you have the option of using mesh compression.
This is a procedural mesh, and Optimize doesn't appear to make any changes to it (which I'm not surprised, as the mesh doesn't lend itself well to optimization). The vertices are all on integer boundaries, there wouldn't be a vertex at a coordinate like 1.105, etc. Think $$anonymous$$ecraft, the terrain blocks are all 1 unit in size.
Is this not even avaialable with Unity pro?
Well, see the docs: $$anonymous$$esh.vertices var vertices: Vector3[]
. That's the only option.
Your answer
Follow this Question
Related Questions
Huge world without huge lag? 1 Answer
Memory problems with procedurally generated meshes 2 Answers
Mesh memory leak 3 Answers
Strange shading on procedural mesh 0 Answers
Why is my mesh getting messed up 1 Answer