Post

Replies

Boosts

Views

Activity

Reply to SceneKit Metal shader no longer compiles in Xcode 13.
Okay it looks like things have changed a bit, and a little reading of the original instructions at: https://developer.apple.com/documentation/scenekit/scnshadable#1654834 have cleared things up for me. In short, my float2 should be described as: #pragma arguments float2 worldDimensions; and after that the #pragma body #pragma transparent The shader now works fine again. Also, the SIMD files are presumably empty because they are deprecated in favor of just using the float2, float4 Metal types directly.
Topic: Graphics & Games SubTopic: General Tags:
Sep ’21
Reply to SCNRenderer in MTKView doesn't render shadows.
UPDATE: This turned out to be a case of user error. The camera in the SceneKit scene was having the projection matrix overwritten by the projection matrix of the ARKit frame camera in order to keep in sync (we can't use ARSCNView for our needs). However, overwriting the projection matrix changed the near/far which meant the shadows weren't renderered correctly. Using the alternative method: node.camera.projectionTransform = SCNMatrix4(frame.camera.projectionMatrix(for: .landscapeRight, viewportSize: CGSize(width: width, height: height), zNear: 0.1, zFar: 1000))
Topic: Graphics & Games SubTopic: Metal Tags:
Mar ’21