CelestiaProject / Celestia

Real-time 3D visualization of space.
https://celestiaproject.space
GNU General Public License v2.0
1.77k stars 301 forks source link

Render artifacts when a model self-intersected more than twice #1861

Open Askaniy opened 11 months ago

Askaniy commented 11 months ago

Artifacts when a model self-intersects more than twice. Probable was also seen on Phobos by NGTS addict / thelostprobe here.

Screenshot_20230821_172014

munix9 commented 11 months ago

hm, lgtm, maybe it depends on the hardware. or have you made special settings? grafik

Askaniy commented 11 months ago

I tested on a laptop with Intel graphics (currently unavailable until tomorrow, battery issues) and PC with Radeon graphics. There were no special settings and no modifications

munix9 commented 11 months ago

More details from my side: tested on two notebooks, each with the same openSUSE Tumbleweed and there are no artifacts.

openSUSE Tumbleweed 20230819

$ inxi --graphics

Graphics:
  Device-1: Intel 3rd Gen Core processor Graphics driver: i915 v: kernel
  Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.1.2 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: crocus gpu: i915
    resolution: 1920x1080~60Hz
  API: OpenGL v: 4.2 Mesa 23.1.5 renderer: Mesa Intel HD Graphics 4000 (IVB
    GT2)
Graphics:
  Device-1: Intel Alder Lake-P Integrated Graphics driver: i915 v: kernel
  Device-2: Chicony USB2.0 Camera driver: uvcvideo type: USB
  Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.1.2 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915
    resolution: 1920x1080~60Hz
  API: OpenGL v: 4.6 Mesa 23.1.5 renderer: Mesa Intel Graphics (ADL GT2)

The output of $ sudo zypper se -si *celestia* *meshopt* would also be interesting (if it is a package installation),

Askaniy commented 11 months ago

  Device-1: AMD Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
    driver: amdgpu v: kernel
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.2
    compositor: kwin_wayland driver: X: loaded: modesetting unloaded: fbdev,vesa
    dri: radeonsi gpu: amdgpu resolution: 3440x1440
  API: OpenGL v: 4.6 Mesa 23.1.5 renderer: AMD Radeon RX 6700 XT (navi22
    LLVM 16.0.6 DRM 3.52 6.4.9-1-default)

S  | Name                         | Type  | Version                         | Arch   | Repository
---+------------------------------+-------+---------------------------------+--------+-------------------------------------------
i+ | celestia                     | пакет | 1.7.0~git20230818+eb1cb28-802.1 | x86_64 | home:munix9:unstable (openSUSE_Tumbleweed)
i  | celestia-common              | пакет | 1.7.0~git20230818+eb1cb28-802.1 | noarch | home:munix9:unstable (openSUSE_Tumbleweed)
i  | celestia-data                | пакет | 1.7.0~git20230807+4b07c07-95.1  | x86_64 | home:munix9:unstable (openSUSE_Tumbleweed)
i  | celestia-data-avif           | пакет | 1.7.0~git20230807+4b07c07-34.3  | noarch | home:munix9:unstable (openSUSE_Tumbleweed)
i  | celestia-data-lang           | пакет | 1.7.0~git20230807+4b07c07-95.1  | noarch | home:munix9:unstable (openSUSE_Tumbleweed)
i+ | celestia-lang                | пакет | 1.7.0~git20230818+eb1cb28-802.1 | noarch | home:munix9:unstable (openSUSE_Tumbleweed)
i  | celestia-qt5                 | пакет | 1.7.0~git20230818+eb1cb28-802.1 | x86_64 | home:munix9:unstable (openSUSE_Tumbleweed)
i+ | celestia-qt6                 | пакет | 1.7.0~git20230818+eb1cb28-802.1 | x86_64 | home:munix9:unstable (openSUSE_Tumbleweed)
i  | libcelestia1_7               | пакет | 1.7.0~git20230818+eb1cb28-802.1 | x86_64 | home:munix9:unstable (openSUSE_Tumbleweed)
i  | libcelestia1_7-x86-64-v3     | пакет | 1.7.0~git20230818+eb1cb28-802.1 | x86_64 | home:munix9:unstable (openSUSE_Tumbleweed)
i  | libmeshoptimizer2d           | пакет | 0.19-4.4                        | x86_64 | home:munix9:unstable (openSUSE_Tumbleweed)
i  | libmeshoptimizer2d-x86-64-v3 | пакет | 0.19-4.4                        | x86_64 | home:munix9:unstable (openSUSE_Tumbleweed)```
munix9 commented 11 months ago

Ah, you are using the converted avif images, that could be the problem - at least it is the difference with my setup.

I will test and report.

munix9 commented 11 months ago

The problem is reproducible and is probably related to converted images.

Whether this is due to the avif implementation or the conversion of the images, I can not say, the problem is reproducible with the AppImage version of celestia, which contains the avif images for storage space reasons.

Tested with celestia-1.7.0~git20230820+bed2d96-lp154.1.1.Build1.1.glibc2.17-x86_64.AppImage

See https://download.opensuse.org/repositories/home:/munix9:/unstable/AppImage/

munix9 commented 11 months ago

The converted image medres/arrokoth.avif actually looks good, I can't see any visual abnormalities to the original medres/arrokoth.jpg.

$ mediainfo arrokoth.*

General
Complete name                            : arrokoth.avif
Format                                   : avif
Codec ID                                 : avif (avif/mif1/miaf/MA1A)
File size                                : 94.4 KiB

Image
ID                                       : 1
Format                                   : av01
Codec ID                                 : av01
Width                                    : 2 048 pixels
Height                                   : 1 024 pixels
Color space                              : YUV
Bit depth                                : 8 bits
Stream size                              : 84.5 KiB (89%)
Matrix coefficients                      : BT.601
Color range                              : Full
Describes                                : 2,3
Codec configuration box                  : av1C

General
Complete name                            : arrokoth.jpg
Format                                   : JPEG
File size                                : 308 KiB

Image
Format                                   : JPEG
Width                                    : 2 048 pixels
Height                                   : 1 024 pixels
Color space                              : YUV
Chroma subsampling                       : 4:4:4
Bit depth                                : 8 bits
Compression mode                         : Lossy
Stream size                              : 308 KiB (100%)
ColorSpace_ICC                           : RGB
munix9 commented 11 months ago

I have built celestia without meshoptimizer for testing and now things look better. There are still slight artifacts visible with avif images.

celestia without meshoptimizer for openSUSE Leap 15.4 https://download.opensuse.org/repositories/home:/munix9:/test/15.4/x86_64/

celestia without meshoptimizer as AppImage based on the above mentioned version for Leap 15.4 https://download.opensuse.org/repositories/home:/munix9:/test/AppImage/

Summary: celestia with avif images and without meshoptimizer has slight artifacts. celestia with avif images and with meshoptimizer has significant artifacts.

Askaniy commented 10 months ago

Changed configuration, bug is still there.

Graphics:
  Device-1: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    driver: amdgpu v: kernel
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.2.0
    compositor: kwin_wayland driver: X: loaded: modesetting unloaded: fbdev,vesa
    dri: radeonsi gpu: amdgpu resolution: 3440x1440
  API: OpenGL v: 4.6 Mesa 23.1.6 renderer: AMD Radeon Graphics (renoir LLVM
    16.0.6 DRM 3.52 6.4.12-1-default)

image

A more precise description of the bug: artifacts when a model self-intersected more than twice. Probable was also seen on Phobos by NGTS addict / thelostprobe here.

375gnu commented 10 months ago

A more precise description of the bug: artifacts when a model self-intersected more than twice.

That explains why the bug disappears without meshoptimizer.

munix9 commented 10 months ago

Is there anything I can specify when converting the images or is it in the processing of avif images in celestia?

Because as far as I know the problem only occurs with avif.

375gnu commented 10 months ago

Maybe it makes sense not to convert affected textures to avif? And also we need a parameter to disable meshoptimizer on per-object basis.

munix9 commented 10 months ago

Maybe it makes sense not to convert affected textures to avif? And also we need a parameter to disable meshoptimizer on per-object basis.

Maybe. I'm also considering delivering only the original medres images in the appimage as an alternative.