Great but...please a double precison solution

Hello,

I am not a C++ expert nor a unreal engine expert but for now 6 month I am trying to prototype an application I would like to use to work with advertising agency …there is a lot to do about virtual products…but I need some advanced options.

So I’d try first with blueprint and discover the float/double precision problem…then I try to make it in C++ but it’s much more complicated for me as you can consider me as an “artist” and not a programmer. I also tried to use math expression too but some of my data are like 0.000000000875 and so in float the result is 0 which is not possible…and multiply the value by 1000000 then divide the result is not possible as the algorithm is very complicated.

also small bug ? math expression can’t start with a negative value like -2.79…

So…to make it shorter : I can see that you would like Architect, Enterprises, Engineers to use more UE4 but I think they also need double precision … at least to make calculation and then convert the result to float if there is no other solution. So please can you do something here ? And if there is already a solution please make it more visible because after hours of search on the web I didn’t find a solution…all I find is obsolete or useless

This said I love UE4.Thanks !

What are you trying to do?

Make a custom engine build that uses doubles.

Or you could alter your algorithm to be in a higher exponent instead.

Instead of 0.00000000000875 you calculate with 875 and shift it afterwards

Hello ! what do you mean by custom build ?

Few different things and one is using astronomical values.

That doesn’t help, are you trying to do a very large world or are you simply trying to do some math in Blueprints?

Sorry: both. A very large world but not problem until now has I am using world composition but I am not sure I will not have some trouble later in the project. And math in the project also: I can do it but I know that the result will be not as accurate as it should be because by example when using expression using 0.000000956717 / 367.25 (just example : false equation). But UE4 is so impressive on a lot of aspect that I am disappointed not to find double. Ok I imagine engineer will use C++ if they face such problem but I am not and don’t have that people in my team… so…

You can get the unigine engine, for only 10.000 dollars :smiley:

Blueprints have enforced smaller floating point range on input fields.
You don’t need doubles, you just have to use C++.
3D coordinate system in double precision is generally a bad idea, GPUs would take 4x more time to run the math instead of increasing performance.

Yes…one more thing to learn…that makes harder to reach goals for small teams or studios.

Search for ‘landscape origin shift’… basically anywhere in the world, the origin can be reset therefore, the floating point of the coordinates will never be big enough to cause jitter (and inaccuracies).

for me the only solution is to go C++…which is not so easy for an “artist” . Blueprint is an almost “easy” solution for artists but not C++. I need to be able to use numbers like : 4.6692568 which is convert by float to : 4.669257

Converting everything to double (if it is even possible) will not work, as physx is using float (32 bit) internally.

So let’s upgrade physix to double…CPU now can handle this isn’t it ?! For me the only actual solution is to go C++ which is not “artist oriented” …but as indie…no choice

Good then, than PhysX is on the way out and be replaced by Chaos.

You can render only using camera space transliting all world coordinates to reltively to camera.

Doubles for World Cordinates aka spatial seraching (traces, sweeps), won’t make any noticeable performance difference on PC or consoles (next gen at least).

1 Like

Yeah people on the webs also say things like that…
And websites are running slower and slower even though today’s hardware is over 100x faster than when they adopted that mentality :stuck_out_tongue:

Handle it? Yes. Handle it efficiently? No.

Most SIMD lanes on CPUs are still 128 bits wide. So, you either get 2x64 values (e.g., doubles), or 4x32 values (e.g., floats) per operation. That means you require twice as many mathematical OPs to do the same thing in float. As well as missing out on various 4 lane tricks.

PhysX can be compiled to use 64 bit precision.

PhysX 2 it was matter of changing single typedef (FReal).

in PhysX 3 it is much more complicated. PhysX 4 assumes floats in many places.

Relying on wheter something is 4.669256687 or 4.669257164 isn’t the best idea.
Generally, the assumption that floating-point type represents exactly the number we want is dangerous.