OpenGL core profile

Is there any way to have Panda3D use the “core” profile for the OpenGL context it uses from the OS (at least on OS X)?

The problem I’m running into is that on OS X, apparently, the “compatibility” profile is limited to OpenGL 2.1, regardless of what the hardware/drivers are actually capable of, and OpenGL 3/4 functionality is only available when using the core profile… From what I can tell Panda3D uses compatibility mode, so advanced features which work fine on other platforms just don’t work on OS X…

(honestly, all the headaches Apple has caused me with this project thus far have made me really tempted, even assuming I do finally get things working, to deliberately never release a version of my game for Mac, just out of spite…)

I’ve been working on supporting core-only contexts in our OpenGL renderer, but it’s no easy task. Currently, it’s a compile time option only. You have to pass --override SUPPORT_FIXED_FUNCTION=UNDEF to the makepanda command-line. I haven’t tested it on Mac OS X - the Cocoa code may have to be modified to request a GL 3.1 context.

Of course, shaders are required, either the auto-shader generator or custom GLSL shaders. Panda will use a simple GLSL shader for rendering GUI elements and text in absence of a custom shader assignment.

Addendum, for those reaching this thread through search: As of the latest development version, it is possible to switch to a 3.2+ context by setting “gl-version 3 2” in the Config.prc file. This does not require building Panda from source. This was supported before but only today did I check in the necessary code to make this work on macOS.

I have added gl-version 3 2 in my Config.prc file, however, it appears that I still do not have access to GLSL version 150:

:display:gsg:glgsg(error): An error occurred while compiling GLSL vertex shader created-shader:
ERROR: created-shader:2: '' :  version '150' is not supported

System info:

MacOS Catalina 10.15.6
Model Name: MacBook Pro
      Model Identifier: MacBookPro16,1
      Processor Name: 8-Core Intel Core i9
      Processor Speed: 2.3 GHz
      Number of Processors: 1
      Total Number of Cores: 8
      L2 Cache (per Core): 256 KB
      L3 Cache: 16 MB
      Hyper-Threading Technology: Enabled
      Memory: 16 GB


    Intel UHD Graphics 630:

      Chipset Model: Intel UHD Graphics 630
      Type: GPU
      Bus: Built-In
      VRAM (Dynamic, Max): 1536 MB
      Vendor: Intel
      Device ID: 0x3e9b
      Revision ID: 0x0002
      Automatic Graphics Switching: Supported
      gMux Version: 5.0.0
      Metal: Supported, feature set macOS GPUFamily2 v1

    AMD Radeon Pro 5500M:

      Chipset Model: AMD Radeon Pro 5500M
      Type: GPU
      Bus: PCIe
      PCIe Lane Width: x8
      VRAM (Total): 4 GB
      Vendor: AMD (0x1002)
      Device ID: 0x7340
      Revision ID: 0x0040
      ROM Revision: 113-D3220E-190
      VBIOS Version: 113-D32206U1-019
      Option ROM Version: 113-D32206U1-019
      EFI Driver Version: 01.01.190
      Automatic Graphics Switching: Supported
      gMux Version: 5.0.0
      Metal: Supported, feature set macOS GPUFamily2 v1

Odd. Did you set it before ShowBase initialisation? Could you give me the console output with notify-level-glgsg debug set?

Oof, dumb mistake, I was setting that config value in the wrong Config.prc file (one in a different conda environment)! It looks like I can get up to version 4.1 on this machine.