derpicated / articated

ARticated; An augmented reality application for Android
MIT License
10 stars 5 forks source link

Broken rendering, warped model #17

Closed Mercotui closed 6 years ago

Mercotui commented 6 years ago

Some time in the past year, the rendering started showing unexpected output, in the form of warped models, see image: image1

I suspect this is caused by a driver update, since checkout an older commit from before the change from OpenGL to OpenGL-ES 3.0, show the same behaviour.

Mercotui commented 6 years ago

The lighting seems broken too i suppose

Mercotui commented 6 years ago

The commits i tested were: b12176a (Current HEAD of fix/opengl_access_singleton) b5cbd81 (Current HEAD of master) d2d09f6 (Which uses OpenGL unlike the other two, that use OpenGL-ES 3.0)

All of which show the same behaviour as the picture i posted

idelsink commented 6 years ago

Oh dear

idelsink commented 6 years ago

Call it an Augmented abstract art generator

Mercotui commented 6 years ago

Tested it on the only other linux system with GPU i have currently, a Rapberry PI3. Its slow as hell, but the model is correct: ok unlike my desktop, which has an AMD Radeon HD7870, using the radeon driver: notok

@idelsink Can post what happens on your machine? I know you run an NVIDIA GPU, so depending on your findings, maybe we can start to narrow down on the problem.

Mercotui commented 6 years ago

Actually, i tried it today on some other hardware, and it does not look good. On Intel Haswell integrated graphics, using the i915 driver: on-intel-ig On NVIDIA Quadro m2000 with the stupidly named NVIDIA drivers for Linux: on_nvidia

So... not sure whats wrong here, but my next guess is a change in the OpenGL (ES) defaults. It seems to be rounding or truncating the vertices to a grid in 3D space, I wonder if this is caused by some OpenGL precision attribute that I don't know about. I guess I'll start comparing OpenGL (ES) versions, profiles, and capabilities.

P.S. It should be noted that currently, the only driver/gpu that I have seen preform as expected is the Raspberry Pi 3 model B, but that was actually running the llvmpipe software based renderer, and not on the Graphics Core IV GPU.

idelsink commented 6 years ago

I tested the following commits on my system with the following results:

My test setup

Mercotui commented 6 years ago

Thank you for the tests, And I must say, this does my head in.. so far I don't see a pattern.

Can I ask you to post a file with the output of the following command:

glxinfo

I have the output from glxinfo of my systems here: My desktop with the Radeon 7878HD: glxinfo_titux.txt The raspberypi, connected from my desktop via ssh with x11 forwarding: glxinfo_tau_ssh_from_titux.txt

And concerning the invalid free on closing the application, lets make a new issue for that, since i really hope that that is not related to the rendering issue. (see issue #18)

Mercotui commented 6 years ago

And I suppose I should post the other machines I tested on aswell: The NVIDIA Quadro machine on NVIDIA driver: glxinfo_t_nvidia.txt And the Intel Hasswell integrated graphics on i915 driver: glxinfo_t_intel.txt

idelsink commented 6 years ago

The following file lists glxinfo command output. I'm using a Nvidia GTX 770 with the rpmfusion-nonfree driver glxinfo-nvidia-gtx770.txt

Mercotui commented 6 years ago

Ok, this bug was finally fixed in 6aa69e14ed39dc5f5b1a4f5d3061034147e32573 and I'm closing the issue!

The bug is actually not in the rendering, but the model parsing. Specifically, the parsing of the vertex coordinates would truncate the fractional part of the floating point number, if the C Locale is set to Dutch. QT does this in the core application apparently.

This post helped me out: https://stackoverflow.com/questions/24200946/atof-truncates-fractional-parts-after-qapplication

Well this was fun. Now that the rendering works again, I feel confident enough to merge back all the other open branches.