-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for double precision floats #288
Comments
support for doubles was never completed, maybe one day.. On Mon, Apr 14, 2014 at 7:23 AM, m4nu3lf notifications@github.com wrote:
|
See also the proposed implementation in #334. |
That's planned for 3.0 AFAIK. |
C++ standard:
So if you want to be sure, you have to check:
( this will work with C++98 ). |
Wasn't this fixed in 3.0 already? |
it's not done yet, needs some more work and testing
…On Sat, Mar 11, 2017 at 8:23 AM, Bojidar Marinov ***@***.***> wrote:
Wasn't this fixed in 3.0 already?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#288 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z23LdNaXNGndPbxAPEWlTK6Q-MAQrks5rkoQbgaJpZM4ByNZg>
.
|
Not gonna be done for 3.0 |
What is the current status? What is working? What is missing? How much work is required to get this in? |
I'm not completely sure what needs to be done for this feature (and adding a proper compilation flag for this) happens, but comes to mind:
If you or anyone else would like to do this, feel welcome :) It's quite some work but it would be awesome to get it to work |
Bzzzzt wrong @reduz. I've used them in my project few years ago. You can check on OpenGL wiki. But I remember I had to use some extension for it on my card:
|
https://github.com/Hopetech/libSoftFloat Emulated support for fp64 library. |
I'll add a compilation flag called float and it'll have float=32 and float=64 as arguments. Hopefully we won't have to implement float=128 ;) |
Hello godot dev, I replayed to question about using libSoftFloat in your game engine: Hopetech/libSoftFloat#1 Let me know if you have any questions. |
I am also interested in double-precision floats in Godot. Please implement this if you can. |
If this doesn't get completed, as a workaround you'll be able to keep track of double precision floats in C# (and I believe in C++ also) for scripting. For instance, if it's for something like avoiding jittery movement for large scale (planetary sized) games then keeping track of x,y,z as doubles then converting them to floats when setting the position usually does a good job. It's not ideal, but it's an option. |
@fire 128-bit? Well, that depends on what kind of games you expect Godot to power.
|
Since the |
@asheraryam No, it is not resolved. I have a PR here: #21922 |
@aaronfranke You mention CPU-side, but what about GPU-side? I'm working on shaders for my game and I'm noticing some issues with very small floating point values being rounded down to zero... |
@blaeberry As far as I know, using FP64 (= double precision) in shaders is ill-advised in a game engine. This is because FP64 can be very slow on consumer-grade GPUs. 64-bit floating point performance is intentionally crippled on such GPUs, to incite professionals to buy much more expensive professional-grade GPUs. How do other engines typically handle this? I'm curious to see how they do it 🙂 |
There is a trick to bypass this problem.Although we use FP64, we can convert the coordinate system from world space to the camera-relative coordinate system when calculating animation and final rendering, so that we will not use expensive FP64 in shaders |
I've started a similar discussion on Unity forums. You might find some valuable information there. |
As part of an effort to move all feature proposals to the godot-proposals repo, I wrote this proposal which directly supersedes this issue. It significantly summarizes and elaborates on the discussion about double support in Godot. As such, this issue will now be closed. |
Will 4.0 support 128-bit floats/doubles? |
@3top1a There are no plans to add 128-bit (or arbitrary precision) integers or floats to GDScript, but this could be done by a third-party module. |
Godot does have a fixed point 128bit doubles implementation, but no plans to add to gdscript. |
@fire well yes, but that's a 128-bit integer. (in the core since I'm coding in c++ modules now) |
I was imprecise, its 64.64 float. It is not a 128 bit integer. |
For the record (as this is referenced in various issues), this has been implemented in 4.0 (see godotengine/godot-proposals#892 for details). |
Since I need more number precision for my game, I tried to recompile the engine with REAL_T_IS_DOUBLE, however it doesn't work.
It seems like float have been used here and there in place of the abstract real_t type.
In the other hand b2ConvexDecomp::float32 is defined as real_t... and real_t can be a double precision float (float64). So it is quite confusing.
The text was updated successfully, but these errors were encountered: