• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

3D Does the size matter?

V

Vikom

Guest
Hi!
I'm making preparations for a 3d project. Will there be a difference in performance, if I start considering 64 as a meter, instead of 32 as a meter?
I don't mean adding more details, polygons or anything like that, just more space for integers, achieved by double sizes of models and speed.
 

Mike

nobody important
GMC Elder
In 3D scale of numbers is largely irreverence due to floating point. Personally, I'd have one meter as 1.0, then things are easy to follow and you could easily scale things as well.
If you see a size of 34.123, you know this is 34.123 meters, but at *64, you'll have to work it out every time.
 
V

Vikom

Guest
I'm about making an open world game.
So, the smaller the world is, the better? I though it's always better to use 2^n integers, if possible.
 

Mike

nobody important
GMC Elder
This is a pretty large topic.... in general for "large" open worlds you need to break them up into "chunks" or "sectors". How large you make seach sector is up to you, last time I did it, I used 250meter square chunks. You need use an INT64 (or as large an INT as you can) for storing the relative location of this "chunk". Prior to rendering, you subtract the chunk origin from the camera origin to make it more local, cull it, then draw using a much smaller origin offset value - which will then live inside a float quite happily.

But vertex data is always floats due to the GPU pipeline, so make them like you would other models. at (say) 250meter sized blocks, you won'y have too many issues.
 
V

Vikom

Guest
I know about need of chunks and I'm counting on it.
Now I'm gonna model few basic models, then I'll try what's the optimal size of the chunk with them. (that's the reason why I was asking about the size)
Sorry, my English is not perfect. I'm not sure about the part with INT64. (also, according to documentation, I don't exactly understand the use of it)
 
Top