question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support 64bit float in PLY loader

See original GitHub issue

Is your feature request related to a problem? Please describe.

In our projects points are very large and we need 64 bit float precision to properly display them.

When using the PLY loader the files are correctly parse, however at the end the arrays are converted to Float32BufferAttribute.

This makes the data unusable.

Describe the solution you’d like

Make the PLY loader use Float64BufferAttribute in the postProcess function (Source)

Describe alternatives you’ve considered

Create an option to output the data as 32 bit or 64 bit buffers.

Additional context

I changed locally the attribute and the class works still perfectly.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
m-schuetzcommented, Dec 14, 2021

Models with large coordinates are typically handled as follows in Potree:

  • Compute the minimum position
  • Subtract the minimum from all positions. Afterwards, the position buffer can be turned into a Float32Array
  • Use the minimum as the position of the SceneNode, so that the vertices get moved back to where they are supposed to be.

For this to work, the worldView matrix must be computed on javascript side in double precision. The huge coordinates of the world matrix and the reversely huge components of the view matrix will cancel each other out, and the resulting worldView matrix can then be cast to a Float32Array and used in a shader.

I can’t remember if I did anything to the PlyLoader to make it work in Potree. Do you have an example available, @christianbrugger ?

Edit: Instead of computing the minimum position, it’s probably cheaper and sufficient to shift by the first vertex of the model, then set it as the SceneNode position.

0reactions
Mugen87commented, Dec 17, 2021

@christianbrugger Sorry, but this issue needs to be solved on application level e.g. with a custom enhancement for PLYLoader. Loaders in general return vertex position data as FP32 which is sufficient for most use cases. Besides, we can’t work with a higher precision on the GPU anyway.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parsing binary Stanford polygon files (PLY) with Pyparsing
What you might want to try is to open the file as text, use pyparsing to parse the header and capture the end...
Read more >
C51: 64-bit Floating-point Operations - Arm Developer
No. The Keil Cx51 compiler does not support 64-bit floating-point math. You may use the double data type, but operations are performed using...
Read more >
[solved] Double precision PLY file - OpenFrameworks Forum
After simply going in the header and changing “double” to “float” it was fixed, I was wondering if there is a trick I'm...
Read more >
The RISC-V Instruction Set Manual
OpenRISC does not support the 2008 revision to the IEEE 754 floating-point standard. • The OpenRISC 64-bit design had not been completed ...
Read more >
VTK File Formats
The XML formats support random access, parallel I/O, and portable data compression and ... short, unsigned_int, int, unsigned_long, long, float, or double.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found