Delve into the world of graphics and game development. Discuss creating stunning visuals, optimizing game mechanics, and share resources for game developers.

All subtopics
Posts under Graphics & Games topic

Post

Replies

Boosts

Views

Created

Metal, Vulkan, OpenGL & Godot
Greetings! I'm preparing to publish an app in Apple Store. It's a 2D Audio app made in Godot, already published in Google Store.. As we know, OpenGL is considered deprecated since iOS 12 / 2018 .. However given the current state of Metal, or Vulkan integration in Godot, and with the idea of bringing the Best possible experience on iOS.. I'm not completely sure what will be the best API to use as primary option.. -As good as Metal, or even Vulkan work in Godot; the fact of the matter is, each API has its strong and weak points.. -Metal: Native on iOS, fully compliant and supported. However it has two weak points: Initial Compilation Freeze - +5 sec. Performance Hit, (although negligible for final user) app uses 25% more CPU (on my iPhone 12). Battery drain? -Vulkan: In godot, Vulkan > MoltenVk > Metal More complex translation layer, but interestingly gives slightly better Performance than Metal.. Initial Compilation doesn't cause Freeze, because is lazy/delayed and performed while the app is starting. Uses 25% less CPU than Metal and gives slightly more stable Framerate. (iPhone 12) However, given the extra complexity it could be more prone to error, or Compatibility Problems, which are known and have been reported with older iOS devices (iPads come to mind..) Right? -OpenGL: No Initial Compilation Needed Max Performance, No CPU munch Universally supported, (in theory?) works Perfectly on my iPhone 12 with iOS 26.3 and 26.4.2 And all in all, gives the best Performance and user experience. -And that's pretty much the situation! Since the graphics API of choice, will have an effect and directly translate to User experience... what's then the best one? -This will be the first app I Publish on Apple Store, so as you can imagine I want to Comply with Apple as much as possible; and bring iOS users the best possible experience. However each one of the APIs seem to have a negative aspect.. Metal: 5sec Compilation Freeze Vulkan: Compatibility Problems? OpenGL: "Deprecated" In practical terms, right now, OpenGL gives the best Performance, and the best User Experience.. So what to do? -The Android version is published in Google Store in OpenGL Compat mode. Works perfectly. Even tho OpenGL has been Deprecated on iOS for 7+ years, it has survived all along, with no announced removal date from Apple. And it seems to work perfectly and be fully operational up to the latest iOS 26 version.. right? Maybe Apple is maintaining it for stability and compatibility reasons, even if they're no longer actively developing it? Butthee "deprecated" label sounds alarming, as if support could drop any day.. So what will be the best choice in this situation? -Will an app built primarily for OpenGL, (with Metal fallback) be Rejected right away in Apple Store? -Otoh Vulkan (via MoltenVK) could be a middle term solution, second best Performance, no Compilation Freeze.. But yeah, the Compatibility aspect is important; and while considerable improvements have been made in Godot's implementation, the current status or possible outcome is harder to assess.. Both Metal and OpenGL seem safer options in that sense..
5
0
619
3d
GKLeaderboard.submitScore succeeds in development but no production users appear on leaderboard
I'm building an iOS word game (Gramfall) and no production App Store users can see their own scores on any leaderboard, despite Game Center authentication succeeding and no errors being thrown. The same code works correctly in development and all 6 leaderboard submissions fire "Score submitted" notifications on my dev device. 6 leaderboards in App Store Connect (3 Classic all-time, 3 Recurring monthly) and all are Live Production App Store users: authenticated, scores submitted, no errors — scores never appear Development build: all 6 submissions confirmed via Settings → Developer → Notify About Score Submissions Affected users cannot see their own score on the leaderboard from their own device. This rules out privacy/visibility restrictions as a player should always see their own score. This suggests submissions are either silently failing or being accepted but not recorded in the production Game Center environment. What we have ruled out Leaderboard ID mismatch (Everything in App Store Connect matches) Authentication failure (GKLocalPlayer.local.isAuthenticated is true, app shows "Connected") All 6 leaderboards load with releaseState(rawValue: 1), isHidden: false Account-level restrictions effectively ruled out as it affects all users, not one account endGame() fires correctly, confirmed in dev Questions Is there a known difference in how GKLeaderboard.submitScore behaves between the sandbox and production Game Center environments that could cause silent failures? Is there any way for a submission to return no error yet still not be recorded in production? Code func submitGameResult(timeSeconds: Int, score: Int, longestWordLength: Int) { guard GKLocalPlayer.local.isAuthenticated else { return } Task { do { try await GKLeaderboard.submitScore(timeSeconds, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.time", "gramfall.lb.time.monthly"]) try await GKLeaderboard.submitScore(score, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.score", "gramfall.lb.score.monthly"]) try await GKLeaderboard.submitScore(longestWordLength, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.longestword", "gramfall.lb.longestword.monthly"]) } catch { print("[GameCenter] submitGameResult failed: \(error)") } } }
0
0
665
1w
Using setVertexBytes for index primitives
When using index primitives is there a method to provide the indices using a temp buffer like setVertexBytes? Right now I have to create a temp metal buffer even for a small number of vertices and toss it after rendering using drawIndexedPrimitives.
0
0
216
1w
Arrow key causes delta jump in spritekit.
Hello, I have a problem where my macOS (Sequoia) Spritekit game spikes delta during the first press of an arrow key. I've test this with a small program, code below: // // GameScene.swift import SpriteKit import GameplayKit class GameScene: SKScene { var lastTime: TimeInterval = 0 override func keyDown(with event: NSEvent) { print("---------------> delta keyDown: \(event.characters!) keyCode: \(event.keyCode)") } override func update(_ currentTime: TimeInterval) { // Called before each frame is rendered print("update begins") let dt: CGFloat if lastTime > 0 { dt = (CGFloat(currentTime - lastTime)) } else { dt = 1.0 / 60.0 } if dt > (1/30) { print("************************************ delta spike ", dt) } lastTime = currentTime print("dt: ", dt) print("update ends") } } Example output: update begins ************************************ delta spike 0.03381687504588626 dt: 0.03381687504588626 update ends update begins dt: 0.016670208307914436 update ends As you can see, when I press left arrow key in this case I get a big delta spike. There's no spike with further presses of the arrow key. Other keys, such as the common W A S D controls for games, do not cause this delta spike.
3
0
1.4k
2w
Blending walk and run animations in RealityKit
Hi everybody, I have 2 separate animations run.usdz and walk.usdz animation files which are loaded perfectly in Reality Composer Pro and in the RealityKit application. I want to gradually increase the speed of my player by switching blending weight values from 0.0 (walking) to 1.0 (full speed running). let rabbit = await RabbitBuilder.loadWalkingRabbit() let runningRabbit = await RabbitBuilder.loadRunningRabbit() rabbit.scale = SIMD3(0.05, 0.05, 0.05) runningRabbit.scale = SIMD3(0.05, 0.05, 0.05) let walkAnimation = rabbit.availableAnimations let runAnimation = runningRabbit.availableAnimations RabbitWalker.walkAnim = walkAnimation.first! RabbitWalker.runAnim = runAnimation.first! guard let walk = RabbitWalker.walkAnim, let run = RabbitWalker.runAnim else { return } let blendTree = BlendTreeAnimation<JointTransforms>( BlendTreeBlendNode(sources: [ BlendTreeSourceNode(source: walk.definition, name: "walk", weight: .value(1 - weight)), BlendTreeSourceNode(source: run.definition, name: "run", weight: .value(weight)) ]), name: "rabbitLocomotion", repeatMode: .repeat, offset: TimeInterval(elapsed) ) // I have runtime error after executing this line: "Cannot add incompatible timeline type to blend tree." guard let resource = try? AnimationResource.generate(with: blendTree) else { return } entity.playAnimation(resource) static func loadWalkingRabbit() async -> Entity? { do { let scene = try await Entity(named: "Scene", in: realityKitEnvironmentBundle) guard let rabbit = await scene.findEntity(named: "RabbitWalk") else { return nil } await rabbit.removeFromParent() return rabbit } catch { return nil } } static func loadRunningRabbit() async -> Entity? { do { let scene = try await Entity(named: "Scene", in: realityKitEnvironmentBundle) guard let rabbit = await scene.findEntity(named: "RabbitRun") else { return nil } await rabbit.removeFromParent() return rabbit } catch { return nil } } But when I run this code I have this error; Cannot add incompatible timeline type to blend tree. By the way I have looked to developer's sample codes from here but I couldn't find any relevant BlendTreeAnimation sample which blends 2 animations. I would very happy if someone could direct me to a solution. Regards.
4
0
332
2w
Cannot submit Game Center leaderboard – asks for app version although app is already live
Hi, I’m stuck with submitting a Game Center leaderboard and wanted to ask if others are seeing the same issue. My setup: App is already live on the App Store Game Center capability is enabled Leaderboard works perfectly in TestFlight (scores are submitted and visible) Problem: When I try to submit the leaderboard for review, I get: “A Game Center enabled app version must be added for review.” This is confusing because: The app already includes Game Center The app is already approved and published Apple documentation says Game Center components can be submitted without a new app version I also tried recreating the leaderboard and checking all settings, but the issue persists. Is this a known App Store Connect issue? Or is there something I’m missing? Thanks!
1
0
210
3w
Issue with Apple Search Ads Attribution Callback (SKAdNetwork / AdAttributionKit)
Dear Apple Developer Technical Support Team, We are currently integrating Apple Search Ads attribution (SKAdNetwork / AdAttributionKit) for our application, but we have been unable to receive any attribution callbacks from Apple. We would appreciate your assistance in diagnosing this issue. App Information: App ID: 1531290216 Bundle ID: com.volvapps.tk2.cn Callback Endpoint: Our server endpoint for receiving attribution postbacks is: https://volvgames.com/.well-known/skadnetwork/report-attribution Issue Description: We have conducted multiple tests under different scenarios, but in all cases, our server has not received any callback from Apple. Test Scenarios: ① Xcode Installation Test Built and launched the app directly via Xcode. Called the following APIs within the app: SKAdNetwork registerAppForAdNetworkAttribution SKAdNetwork updateConversionValue:value Result: No callback received on our server. ②On-Device Developer Mode Test (AdAttributionKit) Enabled AdAttributionKit Developer Mode on a physical iPhone. Configured a development postback using the app’s Bundle ID. Used either the provided developer postback URL or manually entered our endpoint. Created and triggered the postback via “Send Development Postback”. Result: No callback received. ③Additional Attempts Modified the callback URL from: https://volvgames.com/.well-known/skadnetwork/report-attribution to: https://volvgames.com/ Repeated tests under both Xcode and Developer Mode environments. Also attempted triggering postbacks after calling the attribution APIs within the app. Result: Still no callback received in all cases. Additional Question: We understand that certain files may be required for review or troubleshooting. However, we were unable to find where to upload attachments when submitting this request. We would like to provide the following files for your reference: info.plist AdAttribution.mm Could you please advise how we can submit these files to assist with the investigation? We would greatly appreciate any guidance or suggestions you may have regarding this issue. Please let us know if further information is required. Thank you for your support.
0
0
354
3w
SceneKit shader compile and cache issues? :(
I'm making an apple watch game and it's running so smooth and nice while developing but I ran into a showstopping problem that I wouldn't even have noticed until i deleted the app and reinstalled... Every first-run on a freshly installed copy of the game has major frame hitches as it loads assets. Every run after that has ZERO hitches and runs like butter. Even if i install a new version on top of the old one (which is why i never noticed this problem in my almost finished game) it runs smooth. Framerate issues come back if I delete and reinstall. I think it's compiling shaders or caching geometry but I haven't been able to trick it into doing the hard work during non-critical moments in the game. I've tried preloading assets in the main menu, loading at the start of the level, loading and rendering in a tiny part of the screen, rendering behind dialog boxes... it seems no matter what i can only get rid of the frame hitches after the game has been played through once... and I'm going to lose all customers on that first terrible impression even though the game is actually really good and fun when it's running properly... Any suggestions how i can prewarm/precompile the assets to avoid framerate hitches and freezes during gameplay? I thought I was so close to release but I feel this is un-shippable! I can send a link to my test flight build to anyone that wants to see the problem first hand. Also please note that I am artist-forward with a technical lean, but certainly not a real programmer, unfortunately. Jiovanie
1
0
139
3w
D3DMetal Extreme Over Synchronization Issues
Explanation Currently, D3DMetal’s GPU synchronization approach introduces significant compute overhead on the CPU. This specifically affects D3D12 games that use modern rendering pipelines on Apple Silicon. Specifically, I’ve tested Death Stranding 2 On the Beach for how it handles its rendering. And the results are extreme: frame times are suffering from a 42% decrease from synchronization. Although there are obviously other effects at play, such as the overhead introduced by Rosetta and Wine, both of them don’t introduce as much overhead as D3DMetal. This issue isn’t just specific to Death Stranding 2 On the Beach; most games running through D3DMetal suffer from this. Most games still seem to force synchronization to ~30 ms to reach the 30 fps amount. But it could be better with better synchronization, such as how DXMT handles it. Instead of doubling the work, it allows Metal to single-handedly track resource dependencies internally. This is in part due to the unfortunate bad mapping of D3D12 calls onto shared logic between D3D11 and D3D12. System M2 Max Mac Studio — 32 GBs — 30-core GPU macOS 26.4 Tahoe CrossOver 26.1 RC Death Stranding 2 On the Beach — Steam Assassin’s Creed Valhalla — Steam & Ubisoft Connect Thank you for your commitment. Another game that I recommend testing to really see this swell is Assassin’s Creed Valhalla. Feedback FB22426600 - D3DMetal Extereme Over Syncranization Issues
1
1
335
3w
SpriteKit FPS drops significantly on iOS 26.3.1 when touching screen, even in minimal scene
Title: SpriteKit FPS drops significantly on iOS 26.3.1 when touching screen, even in a minimal scene Summary: On a real device running iOS 26.3.1, FPS drops significantly in a very simple SpriteKit scene when touching or moving a finger on the screen. This happens even with a minimal setup where update(_:), touchesBegan, and touchesMoved are not overridden. Because the issue reproduces in a minimal scene, I suspect a performance regression in SpriteKit and/or iOS rather than in app-specific logic. Environment: OS: iOS 26.3.1 Device: iPhone 12 Xcode: 26.3 Build Configuration: Release Framework: SpriteKit FPS measurement: SKView.showsFPS = true Steps to Reproduce: Present a minimal SpriteKit scene. Enable SKView.showsFPS = true. Add only a very small number of nodes to the scene. Do not override update(_:), touchesBegan, or touchesMoved. Repeatedly tap the screen or move a finger around. Actual Result: The scene stays around 60 FPS when idle. FPS drops significantly when touching or moving a finger on the screen. The drop appears to get worse as the node count increases. The issue still reproduces even if touchesMoved is empty or not overridden at all. Expected Result: A minimal scene like this should remain close to 60 FPS even while touching the screen. At minimum, FPS should not drop this much when the app does not perform meaningful touch handling. Notes: Time Profiler does not point to a clear heavy app-specific function; instead, frame time worsens during touch interaction. Since this also reproduces in a minimal scene, I do not believe the root cause is only in my game logic. Similar reports exist describing SpriteKit framerate drops on recent iOS versions, including cases where the issue appears in very simple scenes. Minimal Reproducible Code: import SpriteKit final class TestScene: SKScene { override func didMove(to view: SKView) { backgroundColor = .black scaleMode = .resizeFill let textures = [ SKTexture(imageNamed: "title1"), SKTexture(imageNamed: "title2"), SKTexture(imageNamed: "title3"), SKTexture(imageNamed: "title4"), SKTexture(imageNamed: "title5"), ] let node = SKSpriteNode(texture: textures[0]) node.position = CGPoint(x: size.width * 0.5, y: size.height * 0.5) addChild(node) let anim = SKAction.animate( with: textures, timePerFrame: 8.0 / 60.0, resize: false, restore: false ) node.run(.repeatForever(anim)) } } import UIKit import SpriteKit final class GameViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let skView = SKView(frame: view.bounds) skView.showsFPS = true skView.showsNodeCount = true skView.ignoresSiblingOrder = true skView.preferredFrameRate = 60 view.addSubview(skView) let scene = TestScene(size: skView.bounds.size) skView.presentScene(scene) } }
1
0
215
4w
Best Way to Use MetalFX in Unreal Engine 5.7 for macOS Port?
Hi everyone, We’re currently porting a high-fidelity AA+ PC title built on Unreal Engine 5.7 to macOS (Apple Silicon), and we’re looking for guidance from anyone with experience in this area. At the moment, the game is already runnable on Mac, but not yet at a playable level — we’re seeing performance around 10–15 FPS on an M4 device. We’re actively analyzing and defining the work needed to reach production-quality performance on macOS. One of the key areas we’re exploring is leveraging MetalFX to improve frame rate. However, it seems there’s no official MetalFX plugin or direct integration available for Unreal Engine. Has anyone here successfully integrated MetalFX into a UE5 rendering pipeline, or found a recommended approach to do so? Any insights on best practices, workflows, or references (docs, samples, etc.) would be greatly appreciated. Thanks in advance!
3
0
716
Mar ’26
How to load and draw texture with opacity in Metal
The background I'm finally working to convert my very old Mac kaleidoscope application, ScopeWorks, which was written in OpenGL and Objective-C, to a Multiplatform app in SwiftUI and Metal. I'm using the MetalKit MTKView class, wrapped for SwiftUI as an NSViewRepresentable or UIViewRepresentable. I then provide an MTKViewDelegate that provides a draw method. The draw method fetches the current render pass descriptor, creates a command buffer, sets up a render pipeline, and does its drawing. My renderer's makePipeline method looks like this: func makePipeline() { let library = device.makeDefaultLibrary() let pipelineDesc = MTLRenderPipelineDescriptor() pipelineDesc.vertexFunction = library?.makeFunction(name: "vertex_main") pipelineDesc.fragmentFunction = library?.makeFunction(name: "fragment_main") pipelineDesc.colorAttachments[0].pixelFormat = .bgra8Unorm pipeline = try! device.makeRenderPipelineState(descriptor: pipelineDesc) } And my shaders look like this: struct VertexOut { float4 position [[position]]; float2 texCoord; }; vertex VertexOut vertex_main(const device float2* position [[buffer(0)]], uint vid [[vertex_id]]) { VertexOut out; float2 pos = position[vid]; out.position = float4(pos, 0, 1); out.texCoord = pos * 0.5 + 0.5; // basic mapping return out; } fragment float4 fragment_main(VertexOut in [[stage_in]], texture2d<float> tex [[texture(0)]], constant float4& color [[buffer(1)]]) { constexpr sampler s(address::repeat, filter::linear); // float4 texColor = tex.sample(s, in.texCoord); // return texColor * color; float4 textureColor = {1, 2, 3, 4}; if (all(color == textureColor)) { return tex.sample(s, in.texCoord); } else { return color; } // Sample the texture directly — no color tint applied return tex.sample(s, in.texCoord); } The first part of my MTKViewDelegate's draw method looks like this: func draw(in view: MTKView) { guard let drawable = view.currentDrawable, let descriptor = view.currentRenderPassDescriptor, let pipeline = pipeline, let texture = texture else { return } let commandBuffer = commandQueue.makeCommandBuffer()! let encoder = commandBuffer.makeRenderCommandEncoder(descriptor: descriptor)! encoder.setRenderPipelineState(pipeline) encoder.setFragmentTexture(texture, index: 0) descriptor.colorAttachments[0].clearColor = MTLClearColor(red: 0.0, green: 0, blue: 0, alpha: 1.0) // Draw six equilateral triangles forming the hexagon let radius: Float = 0.6 for i in 0..<6 { let angle = Float(i) * (.pi / 3) let cosA = cos(angle) let sinA = sin(angle) let nextA = Float(i+1) * (.pi / 3) let cosB = cos(nextA) let sinB = sin(nextA) let verts: [simd_float2] = [ simd_float2(0, 0), simd_float2(radius * cosA, radius * sinA), simd_float2(radius * cosB, radius * sinB) ] encoder.setVertexBytes(verts, length: MemoryLayout<simd_float2>.stride * 3, index: 0) // Tell the fragment shader to use the texture color. var textureColor: simd_float4 = simd_float4(1, 2, 3, 4) encoder.setFragmentBytes(&textureColor, length: MemoryLayout<SIMD4<Float>>.stride, index: 1) encoder.drawPrimitives(type: .triangle, vertexStart: 0, vertexCount: 3) One of the things the existing app does is load PNG or TIFF images with an alpha channel, and then overlay parts of the image on top of themselves flipped, so you get interesting Moiré patterns in the lines in the resulting kaleidoscope. For now I'm working on a single sample image, loading it into a texture in Metal, and just rendering it as a hexagon and drawing lines for the triangles that make up the hexagon. (For now I'm using the vertex coordinates as the texture coordinates, so I get a hexagonal part of my texture rather than a single triangular part tessellated into a hexagon. I'll fix that later.) In both iOS and OS I set the clear color to black at the beginning of the draw function. The issue: The source image is mostly transparent, but with a lot of partly transparent pixels. Here's what it looks like in Photoshop, where you can see the transparent parts as a checkerboard pattern: (I tried to crop the original image to show the approximate part that I'm rendering in a hexagon, but it's not exact. Look for the same shapes in the different images to compare them.) When I render my hexagon in the Metal view in the iOS version of the app, it looks like it's forcing each pixel to fully opaque or fully transparent: And in the macOS version of the app, it seems to force ALL the pixels to opaque: I haven't shown all the setup code, because it's' a lot. Is there some rendering mode setup I'm missing in order to get it to draw the pixels into the output based on their opacity, including partial opacity?
2
0
893
Mar ’26
Missing DirectX Calls for Tearing and Depth Bound Test in D3DMetal and GPTK 3
I want to address the missing or incomplete DirectX calls from D3DMetal and Game Porting Toolkit 3. These missing calls have in part caused issue with our porting process and we are reconsidering. Missing or Incomplete Calls DXGI_FEATURE_PRESENT_ALLOW_TEARING — IDXGIFactory5::CheckFeatureSupport — this calls has to do with how VSync is handled and some modern games require it to initialize. Currently D3DMetal return 0 maybe by design but most likely because it’s not integrated. Adding a stub that returns 1 can fix this. I’m my use case I simply Noped the check and forced it to continue. D3D12_FEATURE_D3D12_OPTIONS2.DepthBoundsTestSupported — this call is also not present. Which causes games to not initialize rendering. Thankfully this was fixed by once again skipping the check. But this is essential for water rendering. This could be one reason currently water is not rendering in our game. IDXGIOutput6::GetDesc1().ColorSpace — returns DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 (SDR) on external HDR compatible displays. We were able to fix this by forcing HDR to be enabled. It should return HDR support. These calls may exist but they need to be updated to return the correct values. Specifically for depth bound test you can reference MoltenVK which sets it up on top of Metal since it’s not a native feature. The water issue could be also an issue with how the shaders are compiled. But I’m unable to check because of the closed source nature of GPTK and its debuggers. What is a better way we can debug our game to see why the water isn’t rendering. Does D3DMetal have some debug options or something similar? Feedback Number FB22330617 - Missing DirectX Calls for Tearing and Depth Bound Test in D3DMetal and GPTK 3 We hope these issues are resolved quickly because we were thinking of a simultaneous release with our Windows version, but we can't ship with such large bugs.
6
3
384
Mar ’26
Xcode26 Replay frame broken
Got a broken frame when using Xcode to capture a frame and replay it from a Unity game. It seems like the vertex buffer is broken; I see a bunch of "nan"s in the vertex buffer. However, the game displays correct when running, and it only happend when I upgrade my Xcode and iphone to Xcode26 and IOS26 ios26
1
0
281
Mar ’26
Metal, Vulkan, OpenGL & Godot
Greetings! I'm preparing to publish an app in Apple Store. It's a 2D Audio app made in Godot, already published in Google Store.. As we know, OpenGL is considered deprecated since iOS 12 / 2018 .. However given the current state of Metal, or Vulkan integration in Godot, and with the idea of bringing the Best possible experience on iOS.. I'm not completely sure what will be the best API to use as primary option.. -As good as Metal, or even Vulkan work in Godot; the fact of the matter is, each API has its strong and weak points.. -Metal: Native on iOS, fully compliant and supported. However it has two weak points: Initial Compilation Freeze - +5 sec. Performance Hit, (although negligible for final user) app uses 25% more CPU (on my iPhone 12). Battery drain? -Vulkan: In godot, Vulkan > MoltenVk > Metal More complex translation layer, but interestingly gives slightly better Performance than Metal.. Initial Compilation doesn't cause Freeze, because is lazy/delayed and performed while the app is starting. Uses 25% less CPU than Metal and gives slightly more stable Framerate. (iPhone 12) However, given the extra complexity it could be more prone to error, or Compatibility Problems, which are known and have been reported with older iOS devices (iPads come to mind..) Right? -OpenGL: No Initial Compilation Needed Max Performance, No CPU munch Universally supported, (in theory?) works Perfectly on my iPhone 12 with iOS 26.3 and 26.4.2 And all in all, gives the best Performance and user experience. -And that's pretty much the situation! Since the graphics API of choice, will have an effect and directly translate to User experience... what's then the best one? -This will be the first app I Publish on Apple Store, so as you can imagine I want to Comply with Apple as much as possible; and bring iOS users the best possible experience. However each one of the APIs seem to have a negative aspect.. Metal: 5sec Compilation Freeze Vulkan: Compatibility Problems? OpenGL: "Deprecated" In practical terms, right now, OpenGL gives the best Performance, and the best User Experience.. So what to do? -The Android version is published in Google Store in OpenGL Compat mode. Works perfectly. Even tho OpenGL has been Deprecated on iOS for 7+ years, it has survived all along, with no announced removal date from Apple. And it seems to work perfectly and be fully operational up to the latest iOS 26 version.. right? Maybe Apple is maintaining it for stability and compatibility reasons, even if they're no longer actively developing it? Butthee "deprecated" label sounds alarming, as if support could drop any day.. So what will be the best choice in this situation? -Will an app built primarily for OpenGL, (with Metal fallback) be Rejected right away in Apple Store? -Otoh Vulkan (via MoltenVK) could be a middle term solution, second best Performance, no Compilation Freeze.. But yeah, the Compatibility aspect is important; and while considerable improvements have been made in Godot's implementation, the current status or possible outcome is harder to assess.. Both Metal and OpenGL seem safer options in that sense..
Replies
5
Boosts
0
Views
619
Activity
3d
I do not use currentTime:TimeInterval as the basis for in-game time.
If you are developing a network game, it is best to use server time as the basis for game time. If you are developing a standalone game, it is best to use the rendering frame count as the basis for game time.
Replies
0
Boosts
0
Views
653
Activity
4d
GKLeaderboard.submitScore succeeds in development but no production users appear on leaderboard
I'm building an iOS word game (Gramfall) and no production App Store users can see their own scores on any leaderboard, despite Game Center authentication succeeding and no errors being thrown. The same code works correctly in development and all 6 leaderboard submissions fire "Score submitted" notifications on my dev device. 6 leaderboards in App Store Connect (3 Classic all-time, 3 Recurring monthly) and all are Live Production App Store users: authenticated, scores submitted, no errors — scores never appear Development build: all 6 submissions confirmed via Settings → Developer → Notify About Score Submissions Affected users cannot see their own score on the leaderboard from their own device. This rules out privacy/visibility restrictions as a player should always see their own score. This suggests submissions are either silently failing or being accepted but not recorded in the production Game Center environment. What we have ruled out Leaderboard ID mismatch (Everything in App Store Connect matches) Authentication failure (GKLocalPlayer.local.isAuthenticated is true, app shows "Connected") All 6 leaderboards load with releaseState(rawValue: 1), isHidden: false Account-level restrictions effectively ruled out as it affects all users, not one account endGame() fires correctly, confirmed in dev Questions Is there a known difference in how GKLeaderboard.submitScore behaves between the sandbox and production Game Center environments that could cause silent failures? Is there any way for a submission to return no error yet still not be recorded in production? Code func submitGameResult(timeSeconds: Int, score: Int, longestWordLength: Int) { guard GKLocalPlayer.local.isAuthenticated else { return } Task { do { try await GKLeaderboard.submitScore(timeSeconds, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.time", "gramfall.lb.time.monthly"]) try await GKLeaderboard.submitScore(score, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.score", "gramfall.lb.score.monthly"]) try await GKLeaderboard.submitScore(longestWordLength, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.longestword", "gramfall.lb.longestword.monthly"]) } catch { print("[GameCenter] submitGameResult failed: \(error)") } } }
Replies
0
Boosts
0
Views
665
Activity
1w
Using setVertexBytes for index primitives
When using index primitives is there a method to provide the indices using a temp buffer like setVertexBytes? Right now I have to create a temp metal buffer even for a small number of vertices and toss it after rendering using drawIndexedPrimitives.
Replies
0
Boosts
0
Views
216
Activity
1w
Arrow key causes delta jump in spritekit.
Hello, I have a problem where my macOS (Sequoia) Spritekit game spikes delta during the first press of an arrow key. I've test this with a small program, code below: // // GameScene.swift import SpriteKit import GameplayKit class GameScene: SKScene { var lastTime: TimeInterval = 0 override func keyDown(with event: NSEvent) { print("---------------> delta keyDown: \(event.characters!) keyCode: \(event.keyCode)") } override func update(_ currentTime: TimeInterval) { // Called before each frame is rendered print("update begins") let dt: CGFloat if lastTime > 0 { dt = (CGFloat(currentTime - lastTime)) } else { dt = 1.0 / 60.0 } if dt > (1/30) { print("************************************ delta spike ", dt) } lastTime = currentTime print("dt: ", dt) print("update ends") } } Example output: update begins ************************************ delta spike 0.03381687504588626 dt: 0.03381687504588626 update ends update begins dt: 0.016670208307914436 update ends As you can see, when I press left arrow key in this case I get a big delta spike. There's no spike with further presses of the arrow key. Other keys, such as the common W A S D controls for games, do not cause this delta spike.
Replies
3
Boosts
0
Views
1.4k
Activity
2w
Blending walk and run animations in RealityKit
Hi everybody, I have 2 separate animations run.usdz and walk.usdz animation files which are loaded perfectly in Reality Composer Pro and in the RealityKit application. I want to gradually increase the speed of my player by switching blending weight values from 0.0 (walking) to 1.0 (full speed running). let rabbit = await RabbitBuilder.loadWalkingRabbit() let runningRabbit = await RabbitBuilder.loadRunningRabbit() rabbit.scale = SIMD3(0.05, 0.05, 0.05) runningRabbit.scale = SIMD3(0.05, 0.05, 0.05) let walkAnimation = rabbit.availableAnimations let runAnimation = runningRabbit.availableAnimations RabbitWalker.walkAnim = walkAnimation.first! RabbitWalker.runAnim = runAnimation.first! guard let walk = RabbitWalker.walkAnim, let run = RabbitWalker.runAnim else { return } let blendTree = BlendTreeAnimation<JointTransforms>( BlendTreeBlendNode(sources: [ BlendTreeSourceNode(source: walk.definition, name: "walk", weight: .value(1 - weight)), BlendTreeSourceNode(source: run.definition, name: "run", weight: .value(weight)) ]), name: "rabbitLocomotion", repeatMode: .repeat, offset: TimeInterval(elapsed) ) // I have runtime error after executing this line: "Cannot add incompatible timeline type to blend tree." guard let resource = try? AnimationResource.generate(with: blendTree) else { return } entity.playAnimation(resource) static func loadWalkingRabbit() async -> Entity? { do { let scene = try await Entity(named: "Scene", in: realityKitEnvironmentBundle) guard let rabbit = await scene.findEntity(named: "RabbitWalk") else { return nil } await rabbit.removeFromParent() return rabbit } catch { return nil } } static func loadRunningRabbit() async -> Entity? { do { let scene = try await Entity(named: "Scene", in: realityKitEnvironmentBundle) guard let rabbit = await scene.findEntity(named: "RabbitRun") else { return nil } await rabbit.removeFromParent() return rabbit } catch { return nil } } But when I run this code I have this error; Cannot add incompatible timeline type to blend tree. By the way I have looked to developer's sample codes from here but I couldn't find any relevant BlendTreeAnimation sample which blends 2 animations. I would very happy if someone could direct me to a solution. Regards.
Replies
4
Boosts
0
Views
332
Activity
2w
Can Apple please add Nintendo Switch 2 Pro Controller support? This is a very popular controller.
Hi Apple, Can you please add support for the Nintendo Switch 2 Pro Controller? The first one is supported but the Switch 2 has been out nearly a year now and a lot of people want to use these controllers with macOS and iOS. Can you please consider adding support? Thank you.
Replies
1
Boosts
0
Views
442
Activity
2w
Xcode 26.4 Simulator Won't Load Game Center Data
For apps that support Game Center, calling presentViewController on a GKGameCenterViewController yields no data for leaderboards or achievements, regardless of which iOS version you're simulating (works fine on device, but doesn't work in simulator).
Replies
0
Boosts
0
Views
128
Activity
2w
Cannot submit Game Center leaderboard – asks for app version although app is already live
Hi, I’m stuck with submitting a Game Center leaderboard and wanted to ask if others are seeing the same issue. My setup: App is already live on the App Store Game Center capability is enabled Leaderboard works perfectly in TestFlight (scores are submitted and visible) Problem: When I try to submit the leaderboard for review, I get: “A Game Center enabled app version must be added for review.” This is confusing because: The app already includes Game Center The app is already approved and published Apple documentation says Game Center components can be submitted without a new app version I also tried recreating the leaderboard and checking all settings, but the issue persists. Is this a known App Store Connect issue? Or is there something I’m missing? Thanks!
Replies
1
Boosts
0
Views
210
Activity
3w
Noob ios 26 for game mobile legend só lag 🤮🤮
Why you don’t fix that ?
Replies
1
Boosts
0
Views
350
Activity
3w
Issue with Apple Search Ads Attribution Callback (SKAdNetwork / AdAttributionKit)
Dear Apple Developer Technical Support Team, We are currently integrating Apple Search Ads attribution (SKAdNetwork / AdAttributionKit) for our application, but we have been unable to receive any attribution callbacks from Apple. We would appreciate your assistance in diagnosing this issue. App Information: App ID: 1531290216 Bundle ID: com.volvapps.tk2.cn Callback Endpoint: Our server endpoint for receiving attribution postbacks is: https://volvgames.com/.well-known/skadnetwork/report-attribution Issue Description: We have conducted multiple tests under different scenarios, but in all cases, our server has not received any callback from Apple. Test Scenarios: ① Xcode Installation Test Built and launched the app directly via Xcode. Called the following APIs within the app: SKAdNetwork registerAppForAdNetworkAttribution SKAdNetwork updateConversionValue:value Result: No callback received on our server. ②On-Device Developer Mode Test (AdAttributionKit) Enabled AdAttributionKit Developer Mode on a physical iPhone. Configured a development postback using the app’s Bundle ID. Used either the provided developer postback URL or manually entered our endpoint. Created and triggered the postback via “Send Development Postback”. Result: No callback received. ③Additional Attempts Modified the callback URL from: https://volvgames.com/.well-known/skadnetwork/report-attribution to: https://volvgames.com/ Repeated tests under both Xcode and Developer Mode environments. Also attempted triggering postbacks after calling the attribution APIs within the app. Result: Still no callback received in all cases. Additional Question: We understand that certain files may be required for review or troubleshooting. However, we were unable to find where to upload attachments when submitting this request. We would like to provide the following files for your reference: info.plist AdAttribution.mm Could you please advise how we can submit these files to assist with the investigation? We would greatly appreciate any guidance or suggestions you may have regarding this issue. Please let us know if further information is required. Thank you for your support.
Replies
0
Boosts
0
Views
354
Activity
3w
Deaf friend
I just wonder what to do futures iPhone will change update
Replies
1
Boosts
0
Views
262
Activity
3w
SceneKit shader compile and cache issues? :(
I'm making an apple watch game and it's running so smooth and nice while developing but I ran into a showstopping problem that I wouldn't even have noticed until i deleted the app and reinstalled... Every first-run on a freshly installed copy of the game has major frame hitches as it loads assets. Every run after that has ZERO hitches and runs like butter. Even if i install a new version on top of the old one (which is why i never noticed this problem in my almost finished game) it runs smooth. Framerate issues come back if I delete and reinstall. I think it's compiling shaders or caching geometry but I haven't been able to trick it into doing the hard work during non-critical moments in the game. I've tried preloading assets in the main menu, loading at the start of the level, loading and rendering in a tiny part of the screen, rendering behind dialog boxes... it seems no matter what i can only get rid of the frame hitches after the game has been played through once... and I'm going to lose all customers on that first terrible impression even though the game is actually really good and fun when it's running properly... Any suggestions how i can prewarm/precompile the assets to avoid framerate hitches and freezes during gameplay? I thought I was so close to release but I feel this is un-shippable! I can send a link to my test flight build to anyone that wants to see the problem first hand. Also please note that I am artist-forward with a technical lean, but certainly not a real programmer, unfortunately. Jiovanie
Replies
1
Boosts
0
Views
139
Activity
3w
D3DMetal Extreme Over Synchronization Issues
Explanation Currently, D3DMetal’s GPU synchronization approach introduces significant compute overhead on the CPU. This specifically affects D3D12 games that use modern rendering pipelines on Apple Silicon. Specifically, I’ve tested Death Stranding 2 On the Beach for how it handles its rendering. And the results are extreme: frame times are suffering from a 42% decrease from synchronization. Although there are obviously other effects at play, such as the overhead introduced by Rosetta and Wine, both of them don’t introduce as much overhead as D3DMetal. This issue isn’t just specific to Death Stranding 2 On the Beach; most games running through D3DMetal suffer from this. Most games still seem to force synchronization to ~30 ms to reach the 30 fps amount. But it could be better with better synchronization, such as how DXMT handles it. Instead of doubling the work, it allows Metal to single-handedly track resource dependencies internally. This is in part due to the unfortunate bad mapping of D3D12 calls onto shared logic between D3D11 and D3D12. System M2 Max Mac Studio — 32 GBs — 30-core GPU macOS 26.4 Tahoe CrossOver 26.1 RC Death Stranding 2 On the Beach — Steam Assassin’s Creed Valhalla — Steam & Ubisoft Connect Thank you for your commitment. Another game that I recommend testing to really see this swell is Assassin’s Creed Valhalla. Feedback FB22426600 - D3DMetal Extereme Over Syncranization Issues
Replies
1
Boosts
1
Views
335
Activity
3w
SpriteKit FPS drops significantly on iOS 26.3.1 when touching screen, even in minimal scene
Title: SpriteKit FPS drops significantly on iOS 26.3.1 when touching screen, even in a minimal scene Summary: On a real device running iOS 26.3.1, FPS drops significantly in a very simple SpriteKit scene when touching or moving a finger on the screen. This happens even with a minimal setup where update(_:), touchesBegan, and touchesMoved are not overridden. Because the issue reproduces in a minimal scene, I suspect a performance regression in SpriteKit and/or iOS rather than in app-specific logic. Environment: OS: iOS 26.3.1 Device: iPhone 12 Xcode: 26.3 Build Configuration: Release Framework: SpriteKit FPS measurement: SKView.showsFPS = true Steps to Reproduce: Present a minimal SpriteKit scene. Enable SKView.showsFPS = true. Add only a very small number of nodes to the scene. Do not override update(_:), touchesBegan, or touchesMoved. Repeatedly tap the screen or move a finger around. Actual Result: The scene stays around 60 FPS when idle. FPS drops significantly when touching or moving a finger on the screen. The drop appears to get worse as the node count increases. The issue still reproduces even if touchesMoved is empty or not overridden at all. Expected Result: A minimal scene like this should remain close to 60 FPS even while touching the screen. At minimum, FPS should not drop this much when the app does not perform meaningful touch handling. Notes: Time Profiler does not point to a clear heavy app-specific function; instead, frame time worsens during touch interaction. Since this also reproduces in a minimal scene, I do not believe the root cause is only in my game logic. Similar reports exist describing SpriteKit framerate drops on recent iOS versions, including cases where the issue appears in very simple scenes. Minimal Reproducible Code: import SpriteKit final class TestScene: SKScene { override func didMove(to view: SKView) { backgroundColor = .black scaleMode = .resizeFill let textures = [ SKTexture(imageNamed: "title1"), SKTexture(imageNamed: "title2"), SKTexture(imageNamed: "title3"), SKTexture(imageNamed: "title4"), SKTexture(imageNamed: "title5"), ] let node = SKSpriteNode(texture: textures[0]) node.position = CGPoint(x: size.width * 0.5, y: size.height * 0.5) addChild(node) let anim = SKAction.animate( with: textures, timePerFrame: 8.0 / 60.0, resize: false, restore: false ) node.run(.repeatForever(anim)) } } import UIKit import SpriteKit final class GameViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let skView = SKView(frame: view.bounds) skView.showsFPS = true skView.showsNodeCount = true skView.ignoresSiblingOrder = true skView.preferredFrameRate = 60 view.addSubview(skView) let scene = TestScene(size: skView.bounds.size) skView.presentScene(scene) } }
Replies
1
Boosts
0
Views
215
Activity
4w
Best Way to Use MetalFX in Unreal Engine 5.7 for macOS Port?
Hi everyone, We’re currently porting a high-fidelity AA+ PC title built on Unreal Engine 5.7 to macOS (Apple Silicon), and we’re looking for guidance from anyone with experience in this area. At the moment, the game is already runnable on Mac, but not yet at a playable level — we’re seeing performance around 10–15 FPS on an M4 device. We’re actively analyzing and defining the work needed to reach production-quality performance on macOS. One of the key areas we’re exploring is leveraging MetalFX to improve frame rate. However, it seems there’s no official MetalFX plugin or direct integration available for Unreal Engine. Has anyone here successfully integrated MetalFX into a UE5 rendering pipeline, or found a recommended approach to do so? Any insights on best practices, workflows, or references (docs, samples, etc.) would be greatly appreciated. Thanks in advance!
Replies
3
Boosts
0
Views
716
Activity
Mar ’26
How to load and draw texture with opacity in Metal
The background I'm finally working to convert my very old Mac kaleidoscope application, ScopeWorks, which was written in OpenGL and Objective-C, to a Multiplatform app in SwiftUI and Metal. I'm using the MetalKit MTKView class, wrapped for SwiftUI as an NSViewRepresentable or UIViewRepresentable. I then provide an MTKViewDelegate that provides a draw method. The draw method fetches the current render pass descriptor, creates a command buffer, sets up a render pipeline, and does its drawing. My renderer's makePipeline method looks like this: func makePipeline() { let library = device.makeDefaultLibrary() let pipelineDesc = MTLRenderPipelineDescriptor() pipelineDesc.vertexFunction = library?.makeFunction(name: "vertex_main") pipelineDesc.fragmentFunction = library?.makeFunction(name: "fragment_main") pipelineDesc.colorAttachments[0].pixelFormat = .bgra8Unorm pipeline = try! device.makeRenderPipelineState(descriptor: pipelineDesc) } And my shaders look like this: struct VertexOut { float4 position [[position]]; float2 texCoord; }; vertex VertexOut vertex_main(const device float2* position [[buffer(0)]], uint vid [[vertex_id]]) { VertexOut out; float2 pos = position[vid]; out.position = float4(pos, 0, 1); out.texCoord = pos * 0.5 + 0.5; // basic mapping return out; } fragment float4 fragment_main(VertexOut in [[stage_in]], texture2d<float> tex [[texture(0)]], constant float4& color [[buffer(1)]]) { constexpr sampler s(address::repeat, filter::linear); // float4 texColor = tex.sample(s, in.texCoord); // return texColor * color; float4 textureColor = {1, 2, 3, 4}; if (all(color == textureColor)) { return tex.sample(s, in.texCoord); } else { return color; } // Sample the texture directly — no color tint applied return tex.sample(s, in.texCoord); } The first part of my MTKViewDelegate's draw method looks like this: func draw(in view: MTKView) { guard let drawable = view.currentDrawable, let descriptor = view.currentRenderPassDescriptor, let pipeline = pipeline, let texture = texture else { return } let commandBuffer = commandQueue.makeCommandBuffer()! let encoder = commandBuffer.makeRenderCommandEncoder(descriptor: descriptor)! encoder.setRenderPipelineState(pipeline) encoder.setFragmentTexture(texture, index: 0) descriptor.colorAttachments[0].clearColor = MTLClearColor(red: 0.0, green: 0, blue: 0, alpha: 1.0) // Draw six equilateral triangles forming the hexagon let radius: Float = 0.6 for i in 0..<6 { let angle = Float(i) * (.pi / 3) let cosA = cos(angle) let sinA = sin(angle) let nextA = Float(i+1) * (.pi / 3) let cosB = cos(nextA) let sinB = sin(nextA) let verts: [simd_float2] = [ simd_float2(0, 0), simd_float2(radius * cosA, radius * sinA), simd_float2(radius * cosB, radius * sinB) ] encoder.setVertexBytes(verts, length: MemoryLayout<simd_float2>.stride * 3, index: 0) // Tell the fragment shader to use the texture color. var textureColor: simd_float4 = simd_float4(1, 2, 3, 4) encoder.setFragmentBytes(&textureColor, length: MemoryLayout<SIMD4<Float>>.stride, index: 1) encoder.drawPrimitives(type: .triangle, vertexStart: 0, vertexCount: 3) One of the things the existing app does is load PNG or TIFF images with an alpha channel, and then overlay parts of the image on top of themselves flipped, so you get interesting Moiré patterns in the lines in the resulting kaleidoscope. For now I'm working on a single sample image, loading it into a texture in Metal, and just rendering it as a hexagon and drawing lines for the triangles that make up the hexagon. (For now I'm using the vertex coordinates as the texture coordinates, so I get a hexagonal part of my texture rather than a single triangular part tessellated into a hexagon. I'll fix that later.) In both iOS and OS I set the clear color to black at the beginning of the draw function. The issue: The source image is mostly transparent, but with a lot of partly transparent pixels. Here's what it looks like in Photoshop, where you can see the transparent parts as a checkerboard pattern: (I tried to crop the original image to show the approximate part that I'm rendering in a hexagon, but it's not exact. Look for the same shapes in the different images to compare them.) When I render my hexagon in the Metal view in the iOS version of the app, it looks like it's forcing each pixel to fully opaque or fully transparent: And in the macOS version of the app, it seems to force ALL the pixels to opaque: I haven't shown all the setup code, because it's' a lot. Is there some rendering mode setup I'm missing in order to get it to draw the pixels into the output based on their opacity, including partial opacity?
Replies
2
Boosts
0
Views
893
Activity
Mar ’26
Missing DirectX Calls for Tearing and Depth Bound Test in D3DMetal and GPTK 3
I want to address the missing or incomplete DirectX calls from D3DMetal and Game Porting Toolkit 3. These missing calls have in part caused issue with our porting process and we are reconsidering. Missing or Incomplete Calls DXGI_FEATURE_PRESENT_ALLOW_TEARING — IDXGIFactory5::CheckFeatureSupport — this calls has to do with how VSync is handled and some modern games require it to initialize. Currently D3DMetal return 0 maybe by design but most likely because it’s not integrated. Adding a stub that returns 1 can fix this. I’m my use case I simply Noped the check and forced it to continue. D3D12_FEATURE_D3D12_OPTIONS2.DepthBoundsTestSupported — this call is also not present. Which causes games to not initialize rendering. Thankfully this was fixed by once again skipping the check. But this is essential for water rendering. This could be one reason currently water is not rendering in our game. IDXGIOutput6::GetDesc1().ColorSpace — returns DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 (SDR) on external HDR compatible displays. We were able to fix this by forcing HDR to be enabled. It should return HDR support. These calls may exist but they need to be updated to return the correct values. Specifically for depth bound test you can reference MoltenVK which sets it up on top of Metal since it’s not a native feature. The water issue could be also an issue with how the shaders are compiled. But I’m unable to check because of the closed source nature of GPTK and its debuggers. What is a better way we can debug our game to see why the water isn’t rendering. Does D3DMetal have some debug options or something similar? Feedback Number FB22330617 - Missing DirectX Calls for Tearing and Depth Bound Test in D3DMetal and GPTK 3 We hope these issues are resolved quickly because we were thinking of a simultaneous release with our Windows version, but we can't ship with such large bugs.
Replies
6
Boosts
3
Views
384
Activity
Mar ’26
Xcode26 Replay frame broken
Got a broken frame when using Xcode to capture a frame and replay it from a Unity game. It seems like the vertex buffer is broken; I see a bunch of "nan"s in the vertex buffer. However, the game displays correct when running, and it only happend when I upgrade my Xcode and iphone to Xcode26 and IOS26 ios26
Replies
1
Boosts
0
Views
281
Activity
Mar ’26