diff --git a/Visualization/SpectrumView.m b/Visualization/SpectrumView.m index a721e0de9..a745a29ab 100644 --- a/Visualization/SpectrumView.m +++ b/Visualization/SpectrumView.m @@ -28,7 +28,6 @@ extern NSString *CogPlaybackDidStopNotficiation; BOOL isListening; BOOL bandsReset; BOOL cameraControlEnabled; - BOOL isOpenGL; NSColor *backgroundColor; ddb_analyzer_t _analyzer; @@ -47,20 +46,10 @@ extern NSString *CogPlaybackDidStopNotficiation; - (id)initWithFrame:(NSRect)frame { NSDictionary *sceneOptions = @{ - SCNPreferredRenderingAPIKey: @(SCNRenderingAPIOpenGLCore32) + SCNPreferredRenderingAPIKey: @(SCNRenderingAPIMetal), + SCNPreferredDeviceKey: MTLCreateSystemDefaultDevice(), + SCNPreferLowPowerDeviceKey: @(NO) }; - isOpenGL = YES; - - if(@available(macOS 10.15, *)) { - id device = MTLCreateSystemDefaultDevice(); - if([device supportsFamily:MTLGPUFamilyMac2]) { - sceneOptions = @{ - SCNPreferredRenderingAPIKey: @(SCNRenderingAPIMetal), - SCNPreferredDeviceKey: device - }; - isOpenGL = NO; - } - } self = [super initWithFrame:frame options:sceneOptions]; if(self) { @@ -117,8 +106,6 @@ extern NSString *CogPlaybackDidStopNotficiation; SCNMaterial *material = materials[0]; material.diffuse.contents = barColor; material.emission.contents = barColor; - if(isOpenGL) - material.emission.intensity = 0; } { @@ -128,8 +115,6 @@ extern NSString *CogPlaybackDidStopNotficiation; SCNMaterial *material = materials[0]; material.diffuse.contents = dotColor; material.emission.contents = dotColor; - if(isOpenGL) - material.emission.intensity = 0; } } @@ -345,7 +330,7 @@ extern NSString *CogPlaybackDidStopNotficiation; SCNNode *dotNode = nodes[i + 1 + 11]; SCNVector3 position = node.position; position.y = maxValue * 0.5; - node.scale = SCNVector3Make(1.0, maxValue + 1e-7, 1.0); + node.scale = SCNVector3Make(1.0, maxValue, 1.0); node.position = position; position = dotNode.position;