polyscope icon indicating copy to clipboard operation
polyscope copied to clipboard

shade with debug colors for inf/nan values

Open nmwsharp opened this issue 1 year ago • 2 comments

nmwsharp avatar Dec 29 '24 21:12 nmwsharp

This does not work currently. The glsl isinf() and isnan() functions are not consistently working as expected across various platforms (observed on macOS M3 Pro openGL version: 4.1 Metal - 88.1).

For now, this cannot be merged, but if anyone knows more about crossplatform glsl and wants to suggest a fix that would be welcome!

nmwsharp avatar Dec 29 '24 21:12 nmwsharp

Checkout: https://sakibsaikia.github.io/graphics/2022/01/04/Nan-Checks-In-HLSL.html

GLSL also uses IEE-754 for floating point representation. See: https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)

If you check for mantissa and exponent bits: All 8 exponent bits as 1 + all mantissa bits as 0 signify inf, while all 8 exponent bits as 1 + non-zero mantissa signify nan.

Gaalve avatar Aug 19 '25 22:08 Gaalve