hkrn / nanoem

nanoem is an MMD (MikuMikuDance) compatible implementation and its like cross-platform application mainly built for macOS.
https://nanoem.rtfd.io
Other
296 stars 41 forks source link

[BUG] Broken camera #88

Closed SlawekNowy closed 3 years ago

SlawekNowy commented 3 years ago

Describe the bug When playing empty animation (without keyframes) the camera spins wildly. (Build with ICU and IMGUI Filesystem)

To Reproduce Steps to reproduce the behavior:

  1. Open nanoem.
  2. Click "Play"

Expected behavior Camera stays in place

Screenshots https://youtu.be/xOBcZN0MHCE

Desktop (please complete the following information):

hkrn commented 3 years ago
SlawekNowy commented 3 years ago

System Information: CPU: x86 (64-bit) Platform: Linux Compiler: GCC 11.1.0 (C++14) CRT: GNU C Library.

I set NANOEM_ENABLE_ICU and NANOEM_ENABLE_IMGUI_FILE_DIALOG to ON.

Addendum: Checked debug build. There the bug does not occur. Only in release.

hkrn commented 3 years ago

The bug has been reproduced with gcc 11.1 on Manjaro Linux (and also the debug build doesn't occur).

Resolution

This bug seems to be due to gcc optimization, so the easiest and quickest fix is to use clang instead of gcc as following example commands.

sudo pacman -S clang

cd $NANOEM_DIRECTORY
CC=clang CXX=clang++ NANOEM_TARGET_COMPILER=clang cmake -P scripts/build.cmake

mkdir out
cd out
CC=clang CXX=clang++ NANOEM_TARGET_COMPILER=clang cmake ..
cmake --build .
SlawekNowy commented 3 years ago

Closing since this is compiler bug.