diff --git a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm index e76cf38fa0..3aae8aee63 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm @@ -449,6 +449,11 @@ open_window() { _parent_window_handle->attach_child(_window_handle); } + if (_fb_properties.get_float_color() && + [_view respondsToSelector:@selector(setWantsExtendedDynamicRangeOpenGLSurface:)]) { + [_view setWantsExtendedDynamicRangeOpenGLSurface:YES]; + } + // Configure the view to be high resolution capable using the dpi-aware // configuration flag. If dpi-aware is false, macOS will upscale the view // for us. diff --git a/panda/src/cocoagldisplay/cocoaGLGraphicsStateGuardian.mm b/panda/src/cocoagldisplay/cocoaGLGraphicsStateGuardian.mm index eac4ab3053..9cacb3e270 100644 --- a/panda/src/cocoagldisplay/cocoaGLGraphicsStateGuardian.mm +++ b/panda/src/cocoagldisplay/cocoaGLGraphicsStateGuardian.mm @@ -188,6 +188,10 @@ choose_pixel_format(const FrameBufferProperties &properties, attribs.push_back(NSOpenGLPFAColorSize); attribs.push_back(properties.get_color_bits()); + if (properties.get_float_color()) { + attribs.push_back(NSOpenGLPFAColorFloat); + } + // Set the depth buffer bits to 24 manually when 1 is requested. // This prevents getting a depth buffer of only 16 bits when requesting 1. attribs.push_back(NSOpenGLPFADepthSize);