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

All subtopics

Post

Replies

Boosts

Views

Activity

How to optimise RealityKit performance with many similar objects
I have code such as the following. The performance on the Vision Pro seems to get quite bad once I hit a few thousand of these models. It feels like I should be able to optimise this somehow, perhaps using instancing. Is that possible with RealityKit in visionOS 2? let material = UnlitMaterial(color: .white) let sphereModel = ModelEntity( mesh: .generateSphere(radius: 0.001), materials: [material]) for index in 0..<5000 { let point = generatedPoints[index] let model = sphereModel.clone(recursive: false) model.position = [point.x, point.y, point.z] parent.addChild(starModel) }
0
0
207
2w
Rendering EntityEquipment in TabletopKit
Hi, I've been implementing a tabletop game over the last couple of weeks. One thing that I'm struggling with it getting an EntityEquipment to render. I've followed the instructions in the documentation: https://developer.apple.com/documentation/tabletopkit/entityequipment But still no luck. Any insights what I might be missing are highly appreciated. Note: I've also watched the WWDC24 talk https://developer.apple.com/videos/play/wwdc2024/10091/ several times and downloaded the example but while the pawns render in the example perfectly. In my own implementation of a pawn nothing renders.
1
0
161
2w
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller?
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller? MAJOR REWRITE FOR THE SAKE OF HOPEFULLY (?) INCREASED CLARITY The problem is this = when stopping sound is involved when I do switch SKScenes, if I press the buttons of the GamePad Controller (which cycle thru these other SKScenes) too fast, the movement of the Game Pieces fails to resume when I return to the Game Scene after the above cycling. This problem occurs only with the os(tvOS) version, but not with the iPad version. And the reason for this distinction is that each SKScene for the iPad has to fully load due to the fact that the button I press to switch SKScenes is at the top-left corner of the iPad -- so, by definition, by the time I have access to this button, the current SKScene has fully loaded. By definition, there is no such button for os(iOS). Given this button’s absence, I need the Swift version of jQuery’s $(document).ready (function() {. Any help will be appreciated to the rafters ...
1
0
183
2w
adobe photoshop
Translated Report (Full Report Below) Process: Adobe Photoshop 2024 [4860] Path: /Applications/Adobe Photoshop (Beta)/Adobe Photoshop (Beta).app/Contents/MacOS/Adobe Photoshop 2024 Identifier: com.adobe.Photoshop Version: 25.11.0 (25.11.0) Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2024-07-03 20:14:56.0222 +0200 OS Version: macOS 15.0 (24A5279h) Report Version: 12 Anonymous UUID: BB272497-0BFA-2A39-D111-605692AACBB4 Time Awake Since Boot: 5300 seconds System Integrity Protection: enabled Crashed Thread: 50 Dispatch queue: com.apple.coreml.MLE5ProgramLibrary.lazyInitQueue Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: Adobe Photoshop 2024 [4860] Thread 0:: Main Thread 25.11.0 20240626.m.2679 509bf35 Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x1930125ac __psynch_cvwait + 8 1 libsystem_pthread.dylib 0x193050894 _pthread_cond_wait + 1204 2 QuartzCore 0x19bf1cc40 CA::DispatchGroup::~DispatchGroup() + 68 3 QuartzCore 0x19beefec8 CA::Layer::display_if_needed(CA::Transaction*) + 724 4 QuartzCore 0x19c07e2b4 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 528 5 QuartzCore 0x19bed2514 CA::Transaction::commit() + 648 6 AppKit 0x196d82a48 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 272 7 AppKit 0x19786cc7c ___NSRunLoopObserverCreateWithHandler_block_invoke + 64 8 CoreFoundation 0x193137a50 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 36 9 CoreFoundation 0x19313793c __CFRunLoopDoObservers + 552 10 CoreFoundation 0x193136f70 __CFRunLoopRun + 804 11 CoreFoundation 0x1931365dc CFRunLoopRunSpecific + 608 12 HIToolbox 0x19ea1e8b8 RunCurrentEventLoopInMode + 292 13 HIToolbox 0x19ea24508 ReceiveNextEventCommon + 220 14 HIToolbox 0x19ea2480c _BlockUntilNextEventMatchingListInModeWithFilter + 76 15 AppKit 0x196c5f6f0 _DPSNextEvent + 660 16 AppKit 0x197563530 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 17 Adobe Photoshop 2024 0x104fa9d74 0x102570000 + 44277108 18 AppKit 0x196c527fc -[NSApplication run] + 480 19 Adobe Photoshop 2024 0x104fab4a4 0x102570000 + 44283044 20 Adobe Photoshop 2024 0x104fad444 0x102570000 + 44291140 21 Adobe Photoshop 2024 0x105006240 0x102570000 + 44655168 22 Adobe Photoshop 2024 0x10786d6e4 0x102570000 + 87021284 23 Adobe Photoshop 2024 0x1025751cc 0x102570000 + 20940 24 dyld 0x192ccf274 start + 2840
1
0
180
2w
Crash in glDrawElements() on Apple Silicon Vision Pro Simulator
Hi, we've been developing an iOS game using OpenGL ES, trying running compatible iOS app on Vision Pro Simulator on M1 Mac, but we met a strange EXC_BAD_ACCESS crash in glDrawElements(), while the app run normally on ios or ipad simulators with the same developing environment. The stack like following: Our Mac is a Mac Studio(2022) with Apple M1 Max and MacOS 14.1.2. Xcode: Version 15.3 (15E204a) Simulator OS: Vision OS 1.1
1
1
253
2w
PDF Text Selection Crashes When Cursor Moves Over QR Code Only on iOS 18
We are experiencing a crash when selecting text in a PDF and moving the cursor over a QR code. This happens when the QR code at the end of the PDF file with no text following it. [Only on iOS 18] Steps to Reproduce: Clone the repository: git clone https://github.com/aliakhtar49/ios18-pdf-crash/tree/main cd ios18-pdf-crash Run the application to load the provided PDF Select some text and move the cursor over the QR code several times Observe the crash. You can see the gif in the repo Expected Behavior: The application should not crash Actual Behavior: The application crashes: Environment: iOS version: 18.0 Device: iPhone 15 Pro, iPhone 12 Pro Max Additional Context: This issue occurs when the QR code is at the end of the PDF file with no text following it StackTrace `thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x19f3e6ec0) * frame #0: 0x000000019f3e6ec0 CoreGraphics`void PageLayout::ConvertTextRangesToStringRanges<std::__1::span<CFRange, 18446744073709551615ul>, std::__1::back_insert_iterator<std::__1::vector<CFRange, std::__1::allocator<CFRange>>>>(std::__1::span<CFRange, 18446744073709551615ul>&&, std::__1::back_insert_iterator<std::__1::vector<CFRange, std::__1::allocator<CFRange>>>&&) const + 664 frame #1: 0x000000019f424c5c CoreGraphics`CGPDFPageLayoutGetStringRangeIndexNearestPoint + 100 frame #2: 0x000000022b4c096c PDFKit`-[PDFPage characterIndexNearestPoint:] + 128 frame #3: 0x000000022b450950 PDFKit`-[PDFTextInputView _closestPositionToPoint:withinRange:] + 420 frame #4: 0x00000001a0bd02f0 UIKitCore`-[UITextSelectionInteraction _hasTextAlternativesAtLocation:] + 120 frame #5: 0x00000001a03e3834 UIKitCore`-[_UIRemoteKeyboardsEventObserver _hasTextAlternativesForTouch:] + 256 frame #6: 0x000000019fa4e0f8 UIKitCore`-[_UIRemoteKeyboardsEventObserver _endTrackingForTouch:] + 212 frame #7: 0x000000019fa4ca38 UIKitCore`-[_UIRemoteKeyboardsEventObserver _trackTouch:] + 132 frame #8: 0x000000019fa4c94c UIKitCore`-[_UIRemoteKeyboardsEventObserver peekApplicationEvent:] + 220 frame #9: 0x000000019fa4c304 UIKitCore`-[_UIRemoteKeyboards peekApplicationEvent:] + 84 frame #10: 0x000000019fa35dc4 UIKitCore`__dispatchPreprocessedEventFromEventQueue + 4180 frame #11: 0x000000019fa3ef7c UIKitCore`__processEventQueue + 5696 frame #12: 0x000000019f936df4 UIKitCore`updateCycleEntry + 160 frame #13: 0x000000019f934d28 UIKitCore`_UIUpdateSequenceRun + 84 frame #14: 0x000000019f934978 UIKitCore`schedulerStepScheduledMainSection + 172 frame #15: 0x000000019f93580c UIKitCore`runloopSourceCallback + 92 frame #16: 0x000000019d126f9c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 frame #17: 0x000000019d126f30 CoreFoundation`__CFRunLoopDoSource0 + 176 frame #18: 0x000000019d124a08 CoreFoundation`__CFRunLoopDoSources0 + 244 frame #19: 0x000000019d123c14 CoreFoundation`__CFRunLoopRun + 856 frame #20: 0x000000019d123424 CoreFoundation`CFRunLoopRunSpecific + 608 frame #21: 0x00000001e93211c4 GraphicsServices`GSEventRunModal + 164 frame #22: 0x000000019fc6a130 UIKitCore`-[UIApplication _run] + 816 frame #23: 0x000000019fd1855c UIKitCore`UIApplicationMain + 340 frame #24: 0x0000000105e77c38 MyApp.debug.dylib`main at HSAppDelegate.swift:19:20 frame #25: 0x00000001c3058a74 dyld`start + 2724`
1
1
237
2w
Issue entering immersive mode with Metal
Hi. I am developing an immersive application in Metal. The problem is that when the application starts for the first time, it shows two system windows: one related to the player's surrounding environment and the other to hand tracking permissions. The latter is the one in focus, and when I select the option to grant permissions, both windows disappear and the transition to the immersive view does not occur. I don't know how to handle this issue.
0
0
201
3w
What is the info property of SwiftUI::Layer
What is the info property of SwiftUI::Layer? I couldn't find any document or resource about it. It appears in SwiftUI::Layer's definition: struct Layer { metal::texture2d<half> tex; float2 info[5]; /// Samples the layer at `p`, in user-space coordinates, /// interpolating linearly between pixel values. Returns an RGBA /// pixel value, with color components premultipled by alpha (i.e. /// [R*A, G*A, B*A, A]), in the layer's working color space. half4 sample(float2 p) const { p = metal::fma(p.x, info[0], metal::fma(p.y, info[1], info[2])); p = metal::clamp(p, info[3], info[4]); return tex.sample(metal::sampler(metal::filter::linear), p); } };
0
1
262
3w
Keyboard and Mouse Input in C++ for MacOS
I have worked through the LearnMetalCPP project but it seems that even with the port of AppKit.h to C++ framework, nobody included a method to gain keyboard and mouse inputs in C++. I am under the impression AppKit had a way to manage events with NSEvent and NSResponder, as it mentions in the developer documentation for gaming input systems, but this is excluded from the CPP version of Appkit.h. Can't seem to find a way to handle inputs at all and it's making it seem impossible for anyone to successfully make a game on MacOS in C++. Usually I would be able to handle it with SFML or SDL, but I am wondering since c++ isn't native to macOS if there is any possible way to handle game inputs with C++ at all. It is Apple's hardware, shouldn't they be the ones to create a C++ game input framework? They seem to have a game input framework for every language except for C++. I would understand that they just don't want to do it because C++ isn't native to macOS, but with the new release of Metal CPP, It makes no sense that they wouldn't include a hardware input event system and especially if they want us to port games to MacOS.
1
0
217
3w
Need to get the frames of an animation for streaming in 3rd party video format (macOS)
I have a macos app that creates a sports scoreboard and streams this out in a third party streaming format. I need to use a library for this, which expects a CVPixelBuffer e.g. every 0.04 secs (25 fps). The scoreboard is a view with some subviews (scores, timers, etc) in an offscreen window. When a timer triggers to create a new frame, my code does: • create a bitmap-representation for the view • make a view.cacheDisplay(...) • create a CIImage from the bitmap-representation • create a CVPixelBuffer using CVPixelBufferCreate (kCVPixelFormatType_32BGRA format) • render the CIImage into the CVPixelBuffer using ciContext.render(ciImage, to: pixelBufferOut) • and finally hand over the CVPixelBuffer to the video library. Works, the app is in production. Now I come to the point where I need someone to tell me in which direction I have to think. The next feature requested is to do some animation for the scoreboard graphics , e.g. a simple "fade in" and "fade out". Later I would like to do more complex things, but let's just look at that. When I add a CABasicAnimation(keyPath: #keyPath(CALayer.opacity)) for fade in / fade out to the scoreboard base view (all views with layer), I can see it smoothly fading after I moved my offscreen to onscreen, so the animation works on screen. But in the video stream there is no animation, no fading, the content is shown with opacity 0.0 at one frame and in the next frame 1.0 (fade in) and the other way round for fade out. I have a not-animated, always visible text field displaying a timecode in the video screen and that shows every timecode in the video, so the frames are in fact generated, but contains no scoreboard view with an opacity other than 0 or 1. How can I get the rendered frames from an animation? Is it somehow possible with Core Animation? Do I have to dig into Metal? I searched for hours to find something, but "animation" leads to discussions about animations on screen, while "video" is always about AVFoundation, but there is this library I have to use. Thanks for any hints, Nina
3
0
341
3w
AppleTV Simulator SiriRemote not working in App
Hi, I'm having a small App in the AppleTV-Simulator which is supposed to use the Siri-Remotes Swipe-Gesture. It works perfect on the real device but on the simulator the Swipe-Gesture is not recognized in the App but it works on the Start-Screen of the Simulator using the simulated Siri-Remote app. Here is the code which sets up the xAxis ans yAxis value change handlers: #if targetEnvironment(simulator) // Simulator let siriRemote = GCController.controllers().filter { controller in if controller.vendorName == "Gamepad" { return true } else { return false } } let sController = siriRemote.first! let inputProfile = sController.physicalInputProfile let dPad = inputProfile.dpads["Direction Pad"] self.dPad = dPad self.dPad!.xAxis.valueChangedHandler = self.directionPadXAxisValueChangeHandler self.dPad!.yAxis.valueChangedHandler = self.directionPadYAxisValueChangeHandler } #else // Device if let _ = ( notification.object as? GCController)?.microGamepad { let microProfileController = notification.object as! GCController self.microGamePad = microProfileController.microGamepad self.dPad = self.microGamePad!.dpad self.dPad!.xAxis.valueChangedHandler = self.directionPadXAxisValueChangeHandler self.dPad!.yAxis.valueChangedHandler = self.directionPadYAxisValueChangeHandler } #endif Any help is greatly appreciated. Cheers, Frank
0
0
207
3w
Unity Apple Plugin GameKit Error 37 when sending build to app review
I'm using the Apple Unity Plugins to use Game Center to authenticate Playfab accounts for my game and when I test this on testflight, everything works fine for me and the people I've tested with, however, when I send the build to review, they are getting GameKitException 37 which states "This game is not listed in a marketplace that supports Game Center" and upon further research I found this page https://developer.apple.com/documentation/gamekit/gkerror/code/appunlisted which I'm assuming is the same thing. This seems to suggest that I need my app to be listed on the App Store which is strange because this has created a what comes first, the chicken or the egg problem. I need to pass review to get the game listed in the App Store and they can't test the game because accounts cannot be authenticated with Game Center which apparently needs to be listed on the App Store. So far, I can't find the reason why this doesn't happen on testflight and only happens when I send it to review. I opened a ticket to Apple Developer Support and haven't recieved a response. I asked app review about it and they replied "Hello, Thank you for your response. Since all apps must pass App Review before they can be approved, it should not be necessary to have a "store page". We look forward to reviewing your app once all issues have been addressed and the new build has been received and queued for review. Best regards, App Review" Which doesn't really help me. I am quite pressed for time and I really need assistance in resolving this issue which I cannot replicate. Has anyone encountered this issue or know how to solve it?
2
1
494
3w
Game Center leaderboard works on TestFlight not on live app
I have a VisionOS app that uses a Game Center Leaderboard. On 'appear' of my content view, I check authentication, and if the user is auth'd, I display a 'leaderboard' button. This works on development / TestFlight – the little floating 'Game Center logged-in' pop up shows up when the app runs, and the button appears. Tapping the button opens the leaderboard, and I can tap over to 'global' and see everyone's scores. However, the app launched today on the App Store, and I'm having some issues. The leaderboard button isn't showing up, meaning that the auth call is probably failing silently. Not sure why. If I log out of Game Center on the device, and re-open the app, I'm able to auth and see my leaderboard button. Once I've done that, the leaderboard seems busted. On App Store Connect I can see the values that I expect (high scores from my beta test flight). But, on the production app, the leaderboard is just empty. And there's no 'global' tab to tap on. Wondering if this is a propagation issue? Like, does it take time to roll out the Game Center entitlements when the app is live? I'm going to distribute promo codes to try and get some more people with the App Store version testing for me to see what happens for them. Any help appreciated!
0
1
279
3w