Skip to content

loading shperical harmonics from *_ibl.ktx fails on systems locals using , instead of . for decimal separator  #4883

Closed

Description

Describe the bug
A clear and concise description of what the bug is.

When building my own 3d viewer in open3d which uses filament for rendering i observed that setting indirect lighting by loading *_ibl.ktx file faild with inability to load spherical harmonics from *_ibl.ktx file. The file contains proper 3 x 9 table for spherical harmonics.

After investigation i figured that the reason for this locals sensitivity is the std::strtof function used on line ilament/libs/image/src/KtxBundle.cpp:298 of current master branch to parse the spherical harmonics list. See also std::strtof reference.

To Reproduce
Steps to reproduce the behavior:

  1. set system locals to for example de_DE or de_UTF8

  2. run your program which uses indirect lighting only

  3. surfaces will be black only

  4. Open editor (eg vi/vim)

  5. replace all . in spherical harmonics list (key sh) with ,

  6. rerun demo

  7. Surface colors will be back

Expected behavior
A clear and concise description of what you expected to happen.

That KtxBundle::getSphericalHarmonics returns valid spherical harmonics list independent of which locals are set on the system filament or filament based library is used.

Screenshots
If applicable, add screenshots to help explain your problem.
std::strtof failing on eg.: German locale
std_strtof_failing_on_locale
with , as decimal separator eg: in German locale
with_as_decimal_separator

Logs
If applicable, copy logs from your console here. Please do not
use screenshots of logs, copy them as text.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Mint 20 i386
  • GPU: [e.g. NVIDIA GTX 1080] irrelevant
  • Backend: [OpenGL/Vulkan] guess opengl through intel/open3d python wheel

Smartphone (please complete the following information):

  • Device: [e.g. Pixel 2]
  • OS: [e.g. Android Pie 9.0]

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions