SK3DNode and SCNRenderer multiplies rendered image by itself

I'm encountering a strange issue with SceneKit. When I use an SCNView to render my scene, everything works as expected. However, if I render the same scene in a SKScene using SK3DNode, or if I render the scene using SCNRenderer with a Metal pipeline, the resulting image is the expected image multiplied by itself. I confirmed this by then running the resulting image into an image filter that runs the square root function, which outputs an image that perfectly matches the SCNView output. This issue only occurs when using Metal.

Accepted Reply

I was able to solve the issue when using SCNRenderer by setting my MTKView's pixel format to bgra8Unorm_srgb. I'm not sure how to resolve this using SK3DNode though but directly using metal works for me.

Replies

Here is an image demonstrating the issue. The top trophy is rendered using SCNView, the bottom using SK3DNode:

https://i.imgur.com/AXOuIgt.png

In this image the square root filter is applied to the SpriteKit scene:

https://i.imgur.com/3wQzrVS.png

I was able to solve the issue when using SCNRenderer by setting my MTKView's pixel format to bgra8Unorm_srgb. I'm not sure how to resolve this using SK3DNode though but directly using metal works for me.