erkil1452 / gaze360

Code for the Gaze360: Physically Unconstrained Gaze Estimation in the Wild Dataset
http://gaze360.csail.mit.edu
Other
225 stars 42 forks source link

Shader validation error #26

Closed dyisaev closed 2 years ago

dyisaev commented 3 years ago

Thank you so much for an amazing work. I'm trying to implement your code on my local machine. at the steps where shaders are created I get an error.

shader = shaders.compileProgram(VERTEX_SHADER, FRAGMENT_SHADER)

ShaderValidationError: Validation failure (0):

package versions: lucid 0.2.3 PyOpenGL 3.1.5

I would greatly appreciate any help. Thanks!

dyisaev commented 3 years ago

just in case, for those who need to run the code not in Google Colab, but locally (or, worse, through SSH) - I figured it out. can share with those that might need it.

horanyinora commented 3 years ago

Hey dyisaev,

I am currently having the same OpenGL.GL.shaders.ShaderValidationError. I would really appreciate it if you could share your code with me. I am planning to run this locally. Thanks in advance!

dyisaev commented 3 years ago

Hi @horanyinora ,

here you go: visualization gist

It assumes you have already run DensePose (I did not follow the authors' installation instruction, used DensePose docker container instead).

The main trick is that Colab uses it's own specific libraries to work with OpenGL (lucid), and by some dark magic is able to compile and run OpenGL in the cloud without the screen access.

On a regular Ubuntu machine, OpenGL requires X-window subsystem to render).

So for that you need the 'glfw' library. (I don't remember exactly what I did - but I likely installed it through pip).

Then you need some dark magic of properly working with GLFW library, such as binding arrays of data to shaders. For that I edited a bit the render_frame function, you will see it's a little bit different from Colab version.

Finally, if you want to compile and run OpenGL remotely through ssh you will need VirtualGL package (since simple X forwarding will try to render OpenGL on your local machine).

Thanks, and let me know if this code gives you a correct visualization, since I am going to use it too.

erkil1452 commented 2 years ago

You can in principle get headless (no display) rendering working by switching the OpenGL to eGL (GPU accelerated) or OSMesa (SW only).

More info: