lettier/3d-game-shaders-for-beginners

Shader version 150 not supported on MacOS

hyt589 opened this issue · 6 comments

I can compile and run the demo program on MacOS 10.15.5 Catalina, but it doesn't render anything to the window, and it produces the following log message:

Known pipe types:
  CocoaGraphicsPipe
(all display modules loaded.)
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/base.vert:
ERROR: shaders/vertex/base.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/geometry-buffer-0.frag:
ERROR: shaders/fragment/geometry-buffer-0.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/base.vert:
ERROR: shaders/vertex/base.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/geometry-buffer-1.frag:
ERROR: shaders/fragment/geometry-buffer-1.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/base.vert:
ERROR: shaders/vertex/base.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/geometry-buffer-2.frag:
ERROR: shaders/fragment/geometry-buffer-2.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/ssao.frag:
ERROR: shaders/fragment/ssao.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/screen-space-refraction.frag:
ERROR: shaders/fragment/screen-space-refraction.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/screen-space-reflection.frag:
ERROR: shaders/fragment/screen-space-reflection.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/foam.frag:
ERROR: shaders/fragment/foam.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/fog.frag:
ERROR: shaders/fragment/fog.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/kuwahara-filter.frag:
ERROR: shaders/fragment/kuwahara-filter.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/base.vert:
ERROR: shaders/vertex/base.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/base.frag:
ERROR: shaders/fragment/base.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/refraction.frag:
ERROR: shaders/fragment/refraction.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/reflection-color.frag:
ERROR: shaders/fragment/reflection-color.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/box-blur.frag:
ERROR: shaders/fragment/box-blur.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/reflection.frag:
ERROR: shaders/fragment/reflection.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/base-combine.frag:
ERROR: shaders/fragment/base-combine.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/sharpen.frag:
ERROR: shaders/fragment/sharpen.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/posterize.frag:
ERROR: shaders/fragment/posterize.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/bloom.frag:
ERROR: shaders/fragment/bloom.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/scene-combine.frag:
ERROR: shaders/fragment/scene-combine.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/dilation.frag:
ERROR: shaders/fragment/dilation.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/depth-of-field.frag:
ERROR: shaders/fragment/depth-of-field.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/outline.frag:
ERROR: shaders/fragment/outline.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/pixelize.frag:
ERROR: shaders/fragment/pixelize.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/motion-blur.frag:
ERROR: shaders/fragment/motion-blur.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/film-grain.frag:
ERROR: shaders/fragment/film-grain.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/lookup-table.frag:
ERROR: shaders/fragment/lookup-table.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/basic.vert:
ERROR: shaders/vertex/basic.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/gamma-correction.frag:
ERROR: shaders/fragment/gamma-correction.frag:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader shaders/vertex/discard.vert:
ERROR: shaders/vertex/discard.vert:6: '' :  version '150' is not supported
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader shaders/fragment/discard.frag:
ERROR: shaders/fragment/discard.frag:6: '' :  version '150' is not supported

I tried to change the shaders to version 330, but it is not supported either.

Is there any way to get around this?

rdb commented

You may need to set gl-version 3 2 in the Panda3D Config.prc to tell it to request a core OpenGL profile.

You may need to set gl-version 3 2 in the Panda3D Config.prc to tell it to request a core OpenGL profile.

Hi, thanks for the quick reply!

This is already in the config file but the issue is still not solved.

rdb commented

It must not be taking effect. Perhaps it has not been set correctly, or it is set in the wrong location (eg. if you have more than one Panda3D installation or config file), or your version of Panda3D is outdated.
You can set notify-level-glgsg debug and notify-level-cocoadisplay debug in Config.prc, which will print more information about what is happening. If it does not print more information, then your configuration file is not being read.

@rdb Hi, I tried the options in your reply, and indeed nothing more was getting printed. But I'm struggling to understand why the config file is not being read.

I looked into the main.cxx file and found the following line:

  load_prc_file("config.prc");

And I have the following file structure:

.
├── 3d-game-shaders-for-beginners
├── build-for-linux.sh
├── config.prc
├── eggs
│   └── mill-scene
│       ├── banner.bam
│       ├── mill-scene.bam
│       ├── shutters.bam
│       ├── tex
│       │   ├── banner-diffuse.png
│       │   ├── banner-normal.png
│       │   ├── banner-specular.png
│       │   ├── blank.png
│       │   ├── dock-diffuse.png
│       │   ├── dock-normal.png
│       │   ├── dock-specular.png
│       │   ├── earth-diffuse.png
│       │   ├── earth-normal.png
│       │   ├── earth-specular.png
│       │   ├── grid-floor-diffuse.png
│       │   ├── house-diffuse.png
│       │   ├── house-front-door-diffuse.png
│       │   ├── house-front-door-normal.png
│       │   ├── house-front-door-specular.png
│       │   ├── house-normal.png
│       │   ├── house-roof-diffuse.png
│       │   ├── house-roof-normal.png
│       │   ├── house-roof-specular.png
│       │   ├── house-specular.png
│       │   ├── low-specular.png
│       │   ├── no-specular.png
│       │   ├── normal.png
│       │   ├── reflection-refraction.png
│       │   ├── rock-diffuse.png
│       │   ├── tree-bow-diffuse.png
│       │   ├── tree-branch-diffuse.png
│       │   ├── water-diffuse.png
│       │   ├── water-normal.png
│       │   ├── water-specular.png
│       │   ├── weather-vane-diffuse.png
│       │   ├── wheel-diffuse.png
│       │   ├── wheel-normal.png
│       │   └── wheel-specular.png
│       └── weather-vane.bam
├── fonts
│   └── font.ttf
├── images
│   ├── blank.png
│   ├── color-noise.png
│   ├── foam-pattern.png
│   ├── lookup-table-0.png
│   ├── lookup-table-1.png
│   ├── lookup-table-neutral.png
│   ├── smoke.png
│   ├── still-flow.png
│   └── up-flow.png
├── shaders
│   ├── fragment
│   │   ├── base-combine.frag
│   │   ├── base.frag
│   │   ├── bloom.frag
│   │   ├── box-blur.frag
│   │   ├── depth-of-field.frag
│   │   ├── dilation.frag
│   │   ├── discard.frag
│   │   ├── film-grain.frag
│   │   ├── foam-mask.frag
│   │   ├── foam.frag
│   │   ├── fog.frag
│   │   ├── gamma-correction.frag
│   │   ├── geometry-buffer-0.frag
│   │   ├── geometry-buffer-1.frag
│   │   ├── geometry-buffer-2.frag
│   │   ├── kuwahara-filter.frag
│   │   ├── lookup-table.frag
│   │   ├── material-diffuse.frag
│   │   ├── material-specular.frag
│   │   ├── median-filter.frag
│   │   ├── motion-blur.frag
│   │   ├── normal.frag
│   │   ├── outline.frag
│   │   ├── pixelize.frag
│   │   ├── position.frag
│   │   ├── posterize.frag
│   │   ├── reflection-color.frag
│   │   ├── reflection.frag
│   │   ├── refraction.frag
│   │   ├── scene-combine.frag
│   │   ├── screen-space-reflection.frag
│   │   ├── screen-space-refraction.frag
│   │   ├── sharpen.frag
│   │   └── ssao.frag
│   └── vertex
│       ├── base.vert
│       ├── basic.vert
│       └── discard.vert
├── sounds
│   ├── water.ogg
│   └── wheel.ogg
└── src
    └── main.cxx

where 3d-game-shaders-for-beginners is the executable, and config.prc file is in the same directory, so technically it should be read?

rdb commented

Panda3D ships with a file called "Config.prc", and macOS uses a case-insensitive filesystem, so I suspect that it is picking up its own file instead of the one in this folder. Try renaming the one in 3d-game-shaders-for-beginners to "settings.prc", and adjusting the line in main.cxx to match. Alternatively, try changing main.cxx to specify the absolute path to the file.

@rdb Tried renaming the file and it worked. Thanks for the help ;)