#How does making your model out of a lot of 1x1x1 cubes affect performance?

16 messages · Page 1 of 1 (latest)

silent drift
#

Basically I want to create a voxelizer (for personal purposes) and if I only use the outermost cubes and properly cull their faces (for instance if I convert a 16x16x16 box into 1352 1x1x1 cubes, how much performance drawbacks will I have?

ancient lilyBOT
#
Welcome to the help forum!

Please make sure to read #1029373817119838218 as it may answer your question!

Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.

silent drift
#

PS. I'm not talking about performance in blockbench, but performance in minecraft

gritty atlas
blissful willow
#

Actually 1530 times worse, as that's how much faces even a fully optimized voxel model would minimally still have

#

Additionally you'd have 6120 extra vertices in the model, which roughly equals to 146KB of data that needs to be send to the GPU every time your model needs to be drawn. (Which happens quite regularly based on the use of such a model)

gritty atlas
blissful willow
#

1 cube = 6 faces, turning each pixel at 16x into it's own cube, would result in one face becoming 256 faces.
For 6 faces that equals 1536, substract the 6 original ones, and you have 1530 faces more than before.

gritty atlas
#

which would be 256 times worse
but that's under the assumption the voxel model is removing unnecessary faces

blissful willow
#

and if I only use the outermost cubes and properly cull their faces

#

Using the outermost only, would make culling more innefficient, even increasing the amount of faces to 2708 extra ones.

gritty atlas
#

oh, missed that part

blissful willow
#

Even without culling, performance cost scales by faces, not cubes, so it would've been 1352*6 times worse 😛

#

I guess I should stop my usual performance rant here 😅

gritty atlas
blissful willow
#

That's actually a pretty good point. In that case a fully optimzied voxelized cube would just be 256 times worse.