• Advertisement
Sign in to follow this  

Crysis map sizes and floating point precision

This topic is 3765 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, This is probably a bit of a noobish question, but I'm wondering considering what appears to be a very large continuous lush outdoor level with substantial detail (island.cry) if they are doing anything to counter floating point precision errors when the camera gets far from the origin. I mean, they arent using sectors as they do in a lot of mmo's but then again, the level is small by mmo standards. Are they using a floating origin perhaps? Or is this "big" level really not that big and floating point precision is a non issue for them? Thanks, Hypnotron

Share this post


Link to post
Share on other sites
Advertisement
I'm not an expert and I obviously haven't looked at the Crysis source code, but I seriously doubt that the map is big enough to cause floating point precision issues that are in any way noticable.
I remember writing a geometry exporter using the 3D Max SDK and they represent all their vertex-positions with single-precision floats. Obviously you can build pretty huge stuff in MAX and floats seem to be sufficient for that.

Share this post


Link to post
Share on other sites
Nope. For static geometry, floats might be enough. For anything dynamic such as physics, collision detection or similar floats will leave you pretty soon. Of course I didn't have a chance to look at the Crysis source code but I'm quite sure there's a segmentation scheme employed.

Share this post


Link to post
Share on other sites
if you use half's in the pixel shaders you are running out of precision pretty easily. The way around this is called world camera space or view centric world space. You use then world space aligned axes, but with the origin at the camera. This is done by translating all objects & lights by (-Cx, -Cy, -Cy) before passing them to the shader.
This way positions are smallest near the camera and half precision is maximized where it's important.

Share this post


Link to post
Share on other sites
thanks for the info folks.

Wolf, i'm going to run some tests using the translation method you described. Seems a very inexpensive way to handle things.

Thanks!

Share this post


Link to post
Share on other sites
Sometimes world-space positions of entities are stored in fixed-point, for that exact reason.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement