alecjacobson / computer-graphics-shader-pipeline

Computer Graphics Assignment about the Shader Pipeline
14 stars 22 forks source link

Issue on GLSL 4.10 is not supported #47

Closed s99090 closed 4 years ago

s99090 commented 4 years ago

When I ran ./shaderpipeline ../data//test-01.json, I got the following errors:

$ ./shaderpipeline ../data//test-01.json

Usage:
  [Click and drag]  to orbit view
  [Scroll]  to translate view in and out
  A,a  toggle animation
  L,l  toggle wireframe rending
  Z,z  reset view to look along z-axis
OpenGL version recieved: 3.3.0
Supported OpenGL is 3.3 (Core Profile) Mesa 19.0.8
Supported GLSL is 3.30
../data//test-01.json has changed since last compilation attempt.
-----------------------------------------------
../src/version410.glsl has changed since last compilation attempt.
-----------------------------------------------
ERROR: failed to compile vertex shader
0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 1.00 ES, and 3.00 ES

failed to create tessellation control shader
failed to create tessellation evaluation shader
ERROR: failed to compile fragment shader
0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 1.00 ES, and 3.00 ES

error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader
ERROR: Failed to link shader program
-----------------------------------------------

It says GLSL 4.10 is not supported, what should I do here? Any help?

abhimadan commented 4 years ago

This error means that OpenGL is still on ~version 3, while our code wants version 4. Try upgrading your OpenGL version (sudo apt-get upgrade mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev). You may need to update apt-get's package repository first (sudo apt-get update).

s99090 commented 4 years ago

I tried but it did not upgrade the openGL version, and it is still:

$ glxinfo | grep "OpenGL version"
OpenGL version string: 3.1 Mesa 19.0.8

I am using GTX960M which should support openGL up to 4.5. Are they the same thing? GL 4.5 supports GLSL 4.50?

abhimadan commented 4 years ago

I tried but it did not upgrade the openGL version

What message did you tried to upgrade OpenGL? Also, are you using a lab machine or your own laptop, and if you're using your own laptop, is it WSL or natively Linux? If it's a lab machine, then you may not be able to update software on it, and will have to try another machine that has the appropriate version.

I am using GTX960M which should support openGL up to 4.5. Are they the same thing? GL 4.5 supports GLSL 4.50?

The OpenGL version that the graphics card supports is not the same as the version you can actually use. Remember that OpenGL is an interface from your code that runs on the CPU to GPU instructions, so the version you can use in your code is determined by the library you are linking with your code at compile time. The version your graphics card supports is the latest version of OpenGL it understands, and is backwards-compatible with some older OpenGL versions (which is why your code crashed when you tried to compile a shader - the GPU was fine with the version of OpenGL you had installed).

s99090 commented 4 years ago

I am using my own laptop with WSL. are there any solutions to my issue just using my laptop?

s99090 commented 4 years ago

Should my gpu be able to run this? I think it should be supported, isn't it?

abhimadan commented 4 years ago

It's not a problem with your GPU. As far as I can tell, WSL doesn't support any version of OpenGL newer than 3.x, so that's the root cause here. You'll have to work natively on Windows or use a teaching lab machine to complete this assignment. I'll add a note to the readme for next time we run the course.

s99090 commented 4 years ago

I see, how can I use windows to run this?

abhimadan commented 4 years ago

You'll first need to install the OpenGL driver for Windows from the card manufacturer's website (you should be able to google search to find that). The other steps to set up cmake are largely the same as before, though your will need to delete and re-create your build directory, and run your commands in Powershell or the Windows command line application. For more instructions, see the instructions in https://github.com/alecjacobson/computer-graphics-raster-images.

s99090 commented 4 years ago

I cmake this assignment with windows but when I ran the assignment I received:

PS computer-graphics-shader-pipeline\build_windows\Release> .\shaderpipeline.exe ..\..\data\test-01.json

Usage:
  [Click and drag]  to orbit view
  [Scroll]  to translate view in and out
  A,a  toggle animation
  L,l  toggle wireframe rending
  Z,z  reset view to look along z-axis
OpenGL version recieved: 3.2.0
Supported OpenGL is 3.2.0 - Build 23.20.16.4973
Supported GLSL is 1.50 - Build 23.20.16.4973
..\..\data\test-01.json has changed since last compilation attempt.
-----------------------------------------------

there is a black window popping up but then it stuck there. Do I miss anything here?

And I have installed OpenGL Extensions Viewer, it says the OpenGL Version is 4.5, but why is the OpenGL version recieved is 3.2.0?

s99090 commented 4 years ago

Opened a new issue #50 , hence closing this one.