vpuppr icon indicating copy to clipboard operation
vpuppr copied to clipboard

Flickering/Z-Fighting

Open fmorgner opened this issue 2 years ago • 31 comments

Description

Platform: Linux (Arch) Version: 0.8.0 Python (tracking): 3.9

When using different models, I often encounter flickering in many areas of the models. This is independent of whether or not the tracking is running, and also changes in intensity depending on the angle the model is in. This makes me believe, that it is z-fighting going on there.

Examples

Tracking completely disabled (not listening for data)

https://user-images.githubusercontent.com/196091/151824062-166aa057-f272-4f66-b303-59158384b52f.mp4

Tracking enabled (tracker not running)

https://user-images.githubusercontent.com/196091/151824098-4a830ce8-c9d3-4992-ac64-f1e497e08a99.mp4

Tracking enabled (tracker running

https://user-images.githubusercontent.com/196091/151824084-be2bc73d-fdf5-4cc0-acbb-70490e5b8aac.mp4

fmorgner avatar Jan 31 '22 15:01 fmorgner

Thanks for the report! Is an example model available so I can reproduce this? This is likely a bug in the VRM shader ported to Godot from Unity.

I've tested with the following models and haven't observed any z-fighting:

  1. The reference Alicia model
  2. Various VRoid Studio models
  3. A custom modeled vrm model (sent to me)

Mostly tested on Windows 10 (bundled facetracker exe) and Fedora 32 (via python 3.8)

you-win avatar Jan 31 '22 17:01 you-win

I could share the model with you (it's a free model from booth). Do you have a way I could send it to you?

fmorgner avatar Jan 31 '22 18:01 fmorgner

If it's a free model from booth, you can just paste the link here and I'll download it.

Otherwise if the compressed size is less than 8mb, you can also send me the file directly over Discord and that file will be tested via vm.

you-win avatar Jan 31 '22 18:01 you-win

I just checked with the Alicia model and i get the same effect. This is the link to the booth model: https://booth.pm/en/items/3003329

fmorgner avatar Jan 31 '22 18:01 fmorgner

Thanks for the link, will give it a test later after work.

A few other questions:

  • Are your graphics drivers up to date?
  • Which display server are you using? My Fedora install is using x11, so if you're using Wayland, that ~~would~~ might explain why the Alicia model doesn't work for you either
  • Is your cpu/gpu under heavy load when running the application?

you-win avatar Jan 31 '22 18:01 you-win

  • I am running the most recent drivers (on a Radeon 6900 XT)
  • I have only tested it with wayland so far, I can check X11 later
  • No heavy load on either the CPU or GPU

fmorgner avatar Jan 31 '22 18:01 fmorgner

I can now confirm, that the same effect happens for me on X11 as well (also using the Alicia model).

fmorgner avatar Feb 01 '22 07:02 fmorgner

I'm unable to reproduce with the model you linked:

https://user-images.githubusercontent.com/7788341/152010130-6d8ceb9d-ef95-47ad-bf86-2ddd19480717.mp4

Tested using the Windows build of openseeface-gd 0.8.0, so we can rule out the model causing issues.

Further questions

Does the default Duck model display correctly for you?

I want to see if any 3D models will render correctly on your machine.

If you're willing to do some debugging, can you open the upstream godot-vrm project and see if those render correctly for you?

The upstream project is meant for in-editor use, so theoretically there should be more safety checks or at least better error logging.

Can you post the most recent located at ~/.local/share/godot/ + app name + logs ?

I'm wondering if something important is breaking although, unfortunately, the current state of logging isn't great for catching errors.

you-win avatar Feb 01 '22 16:02 you-win

I can test this on my Linux system tonight (Pop!_OS 20.10 Nvidia Xorg11) and see if it happens to me as well. My personal model works fine though so I'm inclined to believe its something with this specific system (maybe bad GPU drivers?)

ItsRogueRen avatar Feb 01 '22 16:02 ItsRogueRen

Thanks for your investigations! I checked with standard duck, and it renders perfectly fine. However, the godot-vrm example project also exhibits the same flickering. I am starting to believe, that there might be an issue in Godot.

Logfile:

godot.log

fmorgner avatar Feb 02 '22 19:02 fmorgner

The log file looks fine to me, thanks for sending it!

I've talked to the godot-vrm maintainers, and they're of the opinion it's driver bug as they can't reproduce it either.

You could try downgrading your drivers and see if that helps, although this probably isn't a great solution. I'm not sure what else to suggest since I can't reproduce the issue. Sorry for not being of more help.

you-win avatar Feb 03 '22 19:02 you-win

Something like this shows up on my system too. Linux MGF1 5.15.28-1-lts #1 SMP Fri, 11 Mar 2022 14:38:35 +0000 x86_64 GNU/Linux, using NVIDIA 1660Ti.

https://user-images.githubusercontent.com/28266167/159101222-bb451c7d-b5c0-48c6-b7db-9e5c9bace161.mp4

crabdancing avatar Mar 19 '22 01:03 crabdancing

A few questions:

  1. Which distro are you using?
  2. Which nvidia drivers are you using (Nouveau or proprietary)?
  3. How was your model created? Vroid studio only? Vroid studio + UniVRM? Blender + UniVRM?
  4. Can you paste the log located at $HOME/.local/share/OpenSeeFaceGD/logs/godot.log

you-win avatar Mar 19 '22 13:03 you-win

@you-win Oh, me? Arch Linux. Proprietary drivers, 510.54. Shows up on both LTS and non-LTS builds. I believe the model was from only Vroid Studio. I also don't see a log at that path. For reference, I am running openseeface-gd directly from the Godot IDE.

Edit: I found the log you were talking about. It's located at ~/.local/share/godot/app_userdata/OpenSeeFaceGD/logs/godot.log, on my system.

See here.

My money is on some complication with octahedral compression failing. I am pretty comfortable editing GDScript... any workarounds/patches I should try?

crabdancing avatar Mar 19 '22 21:03 crabdancing

@alxpettit Are you able to load in the alicia model located in assets/vrm-models/alicia/AliciaSolid_vrm-0.51.vrm ?

I'm trying to narrow down what might be the problem, but all I can tell right now is that the z-fighting issue only occurs on Arch Linux. I wonder if it's distro-based (since Arch is the only major distro I haven't personally tested).

you-win avatar Mar 19 '22 22:03 you-win

https://user-images.githubusercontent.com/28266167/159140421-d42391d7-c14a-4c7a-806d-5c7b411cc662.mp4

Yep... it happens on Alicia. I'm willing to install a Flatpak version of Godot for a more consistent build to test against, or somesuch, if that's helpful.

crabdancing avatar Mar 19 '22 22:03 crabdancing

Thanks for trying it out and providing a video. I don't think a more official version of Godot will help.

My working theory is that there's a display bug that only exists on Arch for both Nvidia and AMD gpus (as @fmorgner was also running Arch but using an AMD gpu). The hard part about this is that I am unable to reproduce the issue on Windows, Mac, Debian, Ubuntu, PopOS, RHEL, and Fedora.

Further testing steps

  1. Can you force intel integrated graphics to run openseeface-gd ?
  2. Something that will help narrow this down is if your machine running Ubuntu via live cd, can it display the model without flickering. I'm not sure if that's a valid test or not, but it might eliminate hardware being at fault.

What I'll do is install Arch in a vm and see if I can reproduce the issue. If not, I'll need to install Arch on another real machine and see if the issue shows up.

you-win avatar Mar 19 '22 22:03 you-win

I can report that it happens using the Flatpak Godot build, Godot Engine v3.4.3.stable.flathub.242c05d12.

It also happens whether I'm using the NVIDIA renderer or the Mesa one (Mesa Intel(R) UHD Graphics (CML GT2)).

crabdancing avatar Mar 19 '22 22:03 crabdancing

Oh, sorry, you posted that while I was testing :P

Sure, I can try to spin up a Ubuntu system to test it. I'm not sure when I'll have time, but I'll get back to you on that one :)

crabdancing avatar Mar 19 '22 22:03 crabdancing

Arch (X11, Radeon RX 6800, Mesa 22.0.1). I am also getting flickering when rendering with the GPU.

Tested with software rendering (llvmpipe), and it doesn't produce any flickering.

LIBGL_ALWAYS_SOFTWARE=1 ./OpenSeeFaceGD.x86_64

godot-llvmpipe.log godot-mesa.log

Edit: Tested with the proprietary driver also. AMDGPU PRO 21.50 OpenGL renders the Alicia model without any flickering.

26fiftysix avatar Apr 22 '22 10:04 26fiftysix

Thanks for testing with 3 different drivers! Unfortunately, it's really starting to look like a driver bug. I'll still keep this issue open though since more data points can't hurt

you-win avatar Apr 22 '22 19:04 you-win

Could you try and see if this issue is fixed on newer Mesa versions, and with the latest Alpha build? Since it was rewritten since this issue was encountered, it might either introduce some new issues or fix it, who knows?

orowith2os avatar Aug 13 '22 12:08 orowith2os

It seems as though I'm having the same issue with my model created in Vroid. Tried both the Flatpak and the zip, Flatpak has MAJOR eye and eyebrow flickering. zip fixed the eye flickering, but still had flickering eyebrows.

OS: Nobara 36 (Fedora-based) Kernel: 5.19.4-201.fsync.fc36.x86_64 Drivers: Mesa 22.3.0-git.20220827.71ace23.fc36 Display Server: X11

jneurotica avatar Sep 03 '22 00:09 jneurotica

log from zip: godot_2022-09-02_20.35.59.log

log from flatpak: godot_2022-09-02_20.37.50.log

jneurotica avatar Sep 03 '22 00:09 jneurotica

here's a link to my model if you wish to test it out yourself: https://drive.google.com/file/d/1uQcr4EnSI5jQZV1ov-L3wrnfPi8YIcuZ/view?usp=sharing

jneurotica avatar Sep 03 '22 01:09 jneurotica

I have the same issue on Linux mint, but it only appears if my model looks down. It's Linux mint 20.3 with a Nvidia 3070 card. The model has no issues if used with VSeeFace.

Supermagnum avatar Sep 27 '22 12:09 Supermagnum

I have swapped my system from Nvidia GTX 980 Ti to an AMD RX 6650 XT and now also have this flickering/zfighting issue. This may be an AMD/Mesa issue. I have only seen this on Wayland however and have not tested X11

UPDATE: This does happen in X11 as well, so it is not a Wayland exclusive issue.

https://user-images.githubusercontent.com/75085610/201490184-d4006ec7-55bf-47df-9dc7-82b65accf435.mp4

ItsRogueRen avatar Nov 12 '22 18:11 ItsRogueRen

Reproducible on my Radeon RX 570 with the Flatpak

note to self, might be with how models are loaded

orowith2os avatar Nov 15 '22 05:11 orowith2os

Downloading vpuppr, loading a model, and turning on tracking results in this:

https://user-images.githubusercontent.com/1592386/209867052-b5fbd4da-01b9-4745-a44b-5eeee986091e.mp4

System:

  • Arch Linux
  • Intel i9-12900K
  • AMD Radeon 6900 XT
$ pacman -Qs 'mesa'
local/glu 9.0.2-3
    Mesa OpenGL utility library
local/lib32-glu 9.0.2-3
    Mesa OpenGL utility library (32 bits)
local/lib32-mesa 22.3.1-1
    An open-source implementation of the OpenGL specification (32-bit)
local/lib32-vulkan-intel 22.3.1-1
    Intel's Vulkan mesa driver (32-bit)
local/lib32-vulkan-radeon 22.3.1-1
    Radeon's Vulkan mesa driver (32-bit)
local/libva-mesa-driver 22.3.1-1
    VA-API implementation for gallium
local/mesa 22.3.1-1
    An open-source implementation of the OpenGL specification
local/mesa-utils 8.5.0-2
    Essential Mesa utilities
local/mesa-vdpau 22.3.1-1
    Mesa VDPAU drivers
local/opencl-mesa 22.3.1-1
    OpenCL support with clover and rusticl for mesa drivers
local/vulkan-intel 22.3.1-1
    Intel's Vulkan mesa driver
local/vulkan-radeon 22.3.1-1
    Radeon's Vulkan mesa driver

If there's any more information or troubleshooting I can do to help determine the cause, I would be happy to know.

exodrifter avatar Dec 28 '22 20:12 exodrifter

Having this issue as well. Confirmed present on my personal avatar I use for ChilloutVR, as well as the Alicia reference. Forcing software rendering with LIBGL_ALWAYS_SOFTWARE=1 ./vpuppr.x86_64 seems to resolve the issue.

  • Fedora Linux 37
  • XFCE
  • Intel i5-12400
  • Radeon RX 6700 XT
  • 16 GB RAM

Hope this gets fixed soon. This is my first experience with vTubing and even with this bug present, it's honestly kinda incredible.

The1AndMany avatar Apr 12 '23 16:04 The1AndMany