Sign in to follow this  

HLSL Support for Doubles

Recommended Posts


I know that DirectX 11 (Shader Model 5) supports doubles (Although technically optional I believe, but both ATI and NVIDIA quote performance figures for double precision operations, so I guess they both support it.), but how exactly is it supported?

Most HLSL functions seem to only support floats, for example Lerp:

So does this mean that doubles can only be used for basic math and not used in most HLSL functions?

My game world is pretty massive (1 million square miles at the moment) and I'm seeing some strange artifacts on the terrain that I believe are due to floating point precision errors. I've always know that this would happen, but I had been planning to switch to using doubles instead at just take the performance hit, but now I'm not sure how good the support for doubles really is in HLSL.

Failing that I guess I'll have to reread the "Vertex Transform Precision" chapter in "3D Engine Design for Virtual Globes" which provides some more complex solutions to handling massive worlds, but I'd prefer to keep it simpler if possible.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this