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

Post

Replies

Boosts

Views

Activity

Double tap vs triple tap for voiceover
Refering to the apple accessibility plugin for Unity: https://github.com/apple/unityplugins. I have implemented the apple accessibility into my app and it works mostly well. However, why are button clicks (voiceover) triggered by a triple tap instead of a double tap, unlike applications developed using Xcode? Is this normal? Is there a way to change it to a double tap? Thank you
2
1
755
Nov ’23
MTLDebugRenderCommandEncoder Error from Swift Charts
I've started using swift charts and since then get random crashes with the error: Thread 467: hit program assert The console outputs the following at the time of the crash: -[MTLDebugRenderCommandEncoder setVertexBufferOffset:atIndex:]:1758: failed assertion Set Vertex Buffer Offset Validation index(0) must have an existing buffer.` I'm not using Metal directly buit it seems like this is related to Swift Charts. I cannot work out the source of the issue from the stack trace and the debugger shows teh crash in libsystem_kernel.dylib so does not tie back to my code. I'm looking for ideas about where to start to try and find the source of the issue 0 libsystem_kernel.dylib 0x9764 __pthread_kill + 8 1 libsystem_pthread.dylib 0x6c28 (Missing UUID 1f30fb9abdf932dba7098417666a7e45) 2 libsystem_c.dylib 0x76ae8 abort + 180 3 libsystem_c.dylib 0x75e44 __assert_rtn + 270 4 Metal 0x1426c4 MTLReportFailure.cold.1 + 46 5 Metal 0x11f22c MTLReportFailure + 464 6 Metal 0x11552c _MTLMessageContextEnd + 876 7 MetalTools 0x95350 -[MTLDebugRenderCommandEncoder setVertexBufferOffset:atIndex:] + 272 8 RenderBox 0xa5e18 RB::RenderQueue::encode(RB::RenderQueue::EncoderState&) + 1804 9 RenderBox 0x7d5fc RB::RenderFrame::encode(RB::RenderFrame::EncoderData&, RB::RenderQueue&) + 432 10 RenderBox 0x7d928 RB::RenderFrame::flush_pass(RB::RenderPass&, bool)::$_4::__invoke(void*) + 48 11 libdispatch.dylib 0x4400 (Missing UUID 9897030f75d3374b8787322d3d72e096) 12 libdispatch.dylib 0xba88 (Missing UUID 9897030f75d3374b8787322d3d72e096) 13 libdispatch.dylib 0xc5f8 (Missing UUID 9897030f75d3374b8787322d3d72e096) 14 libdispatch.dylib 0x17244 (Missing UUID 9897030f75d3374b8787322d3d72e096) 15 libsystem_pthread.dylib 0x3074 (Missing UUID 1f30fb9abdf932dba7098417666a7e45) 16 libsystem_pthread.dylib 0x1d94 (Missing UUID 1f30fb9abdf932dba7098417666a7e45)
1
0
728
Nov ’23
Is this considered gambling in a mobile app?
Hi all, I had a quick query to see if this would be considered gambling under guidelines - I charge a monthly subscription fee to unlock this feature of my app ($4.99/month) Each subscriber gets 400 of our app's internal currencies. Users can use this app to bet on sporting events. They can bet only on the outcome of the event. They will be provided with live odds through an API. Based on how well they do, the users with the most of our internal currencies at the end of the month will win prizes. Would this process be considered gambling and require licenses on our end? Thank You for your help!!!!
0
0
499
Nov ’23
raytracing circular curves
a circle can be exactly represented as a rational quadratic b-spline curve. in the curve raytracing example a simd_float3 type was used for control points. a rational curve, however, requires an additional homogenious control point coordinate w. is this supported? the math is straightforward an it would open great opportunities to efficiently render solid primitives like torus and tube.
0
0
418
Nov ’23
MLTIO Unavailable in Simulator/iOS 17.x?
I'm trying to use MTLIO Resource Loading in XCode 15.1 b3, but MTLIOCommandQueue, Buffer, etc, come up as undefined types. The Apple sample MetalFastResourceLoading seems to work. But creating a new project from template doesn't recognize the symbols. Anyone see similar? Digging in, it seems the MTLIOCommandQueue.h file in Simulator 17.2 only contains #import <Metal/MTLDefines.h> #import <Metal/MTLDevice.h> Whereas the working sample that links to 14.x contains lots of code. Also, the iOS 17.2 Framework ALSO contains headers with code. However, building for device also comes up with undefined symbols. In addition, the documentation for the type https://developer.apple.com/documentation/metal/mtliocommandqueue lists support for iOS 16+, Vision Beta, etc. Does anyone know if earlier betas work?
0
0
388
Nov ’23
GPTK Installation Error: No Such File or Directory
I am attempting to install Apple's Game Porting Toolkit. I have been following the 'read me' instructions that Apple provides when you install the Game Porting Toolkit package on Apple's developer website. I ran $ brew -v install apple/apple/game-porting-toolkit, which downloaded for around 20 minutes before it reached: ==> Pouring pkg-config--0.29.2_3.sonoma.bottle.tar.gz ln -s ../Cellar/pkg-config/0.29.2_3/bin/pkg-config pkg-config ln -s ../../Cellar/pkg-config/0.29.2_3/share/aclocal/pkg.m4 pkg.m4 ln -s ../../Cellar/pkg-config/0.29.2_3/share/doc/pkg-config pkg-config ln -s ../../../Cellar/pkg-config/0.29.2_3/share/man/man1/pkg-config.1 pkg-config.1 Error: No such file or directory @ rb_sysopen - /Users/anna/Library/Caches/Homebrew/downloads/c5b6da58fb5d679eeb1765833596e7394625255fb46b165955fc4c4de746080e--pkg-config--0.29.2_3.sonoma.bottle.tar.gz I am completely stumped as to what to do in this case. I've tried uninstalling and reinstalling homebrew, trying to install GPTK on a fresh user on my mac, and running brew cleanup and trying to GPTK install again. I would really appreciate any help or suggestions for me to fix this! This is the output of brew doctor: Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected dylibs: /usr/local/lib/libtlImageIO.dylib /usr/local/lib/libtliadjust50.dylib /usr/local/lib/libtliclean30.dylib /usr/local/lib/libtlidejpeg40.dylib /usr/local/lib/libtlieffecta11.dylib /usr/local/lib/libtlieffecta12.dylib /usr/local/lib/libtliinfocus10.dylib /usr/local/lib/libtlistar10.dylib And this is the output of brew config HOMEBREW_VERSION: 4.1.20 ORIGIN: https://github.com/Homebrew/brew HEAD: d3d51d3448966b5250b5c60110c945040054803d Last commit: 8 days ago Core tap JSON: 19 Nov 22:15 UTC HOMEBREW_PREFIX: /usr/local HOMEBREW_CASK_OPTS: [] HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.6zCg6FefHr/org.macosforge.xquartz:0 HOMEBREW_MAKE_JOBS: 10 Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: 10-core 64-bit westmere Clang: 15.0.0 build 1500 Git: 2.39.3 => /Library/Developer/CommandLineTools/usr/bin/git Curl: 8.1.2 => /usr/bin/curl macOS: 14.1.1-x86_64 CLT: 15.1.0.0.1.1699597245 Xcode: 15.1 => /Applications/Xcode-beta.app/Contents/Developer Rosetta 2: true
1
0
1.2k
Nov ’23
Can anyone help me with this problem? most of the games i downloaded from app store or even in steam won't run. even they are compatible with macOS
Translated Report (Full Report Below) Process: Asphalt8 [1703] Path: /Applications/Asphalt8.app/Contents/MacOS/Asphalt8 Identifier: com.gameloft.asphalt8 Version: 7.4.0 (5.0.144) Code Type: X86-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2023-11-22 19:06:58.3982 +0800 OS Version: macOS 14.1.1 (23B81) Report Version: 12 Anonymous UUID: AEBBC989-7D55-FCAB-97CE-851A3B261A43 Sleep/Wake UUID: A1667D0D-B0AE-49E2-A94C-7E34B07BA5B8 Time Awake Since Boot: 1308 seconds Time Since Wake: 444 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000000c0 Exception Codes: 0x0000000000000001, 0x00000000000000c0 Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [1703] VM Region Info: 0xc0 is not in any region. Bytes before following region: 140737487834944 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> shared memory 7ffffff81000-7ffffff82000 [ 4K] r-x/r-x SM=SHM Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 Asphalt8 0x10ecdfda2 0x10d56e000 + 24583586 1 Asphalt8 0x10ecdfac5 0x10d56e000 + 24582853 2 Asphalt8 0x10ec30adb 0x10d56e000 + 23866075 3 Asphalt8 0x10d7fecc9 0x10d56e000 + 2690249 4 Asphalt8 0x10ec103c6 0x10d56e000 + 23733190 5 Asphalt8 0x10d57b89d 0x10d56e000 + 55453 6 Asphalt8 0x10d57bc85 0x10d56e000 + 56453 7 Asphalt8 0x10d575947 0x10d56e000 + 31047 8 CoreFoundation 0x7ff81b872ef6 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 137 9 CoreFoundation 0x7ff81b902cac ___CFXRegistrationPost_block_invoke + 86 10 CoreFoundation 0x7ff81b902bfd _CFXRegistrationPost + 530 11 CoreFoundation 0x7ff81b842e49 _CFXNotificationPost + 826 12 Foundation 0x7ff81c72422e -[NSNotificationCenter postNotificationName:object:userInfo:] + 82 13 AppKit 0x7ff81edf603a -[NSApplication _postDidFinishNotification] + 311 14 AppKit 0x7ff81edf5d82 -[NSApplication _sendFinishLaunchingNotification] + 215 15 AppKit 0x7ff81edf3e27 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 542 16 AppKit 0x7ff81edf3a7c -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 679 17 Foundation 0x7ff81c74cd4e -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 308 18 Foundation 0x7ff81c74cb61 _NSAppleEventManagerGenericHandler + 80 19 AE 0x7ff8228ea9da 0x7ff8228df000 + 47578 20 AE 0x7ff8228ea228 0x7ff8228df000 + 45608 21 AE 0x7ff8228e3b7d aeProcessAppleEvent + 409 22 HIToolbox 0x7ff8265f3664 AEProcessAppleEvent + 55 23 AppKit 0x7ff81ededbae _DPSNextEvent + 1689 24 AppKit 0x7ff81f6e1348 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1304 25 AppKit 0x7ff81eddedfa -[NSApplication run] + 603 26 AppKit 0x7ff81edb2e10 NSApplicationMain + 816 27 Asphalt8 0x10d586484 0x10d56e000 + 99460 28 dyld 0x7ff81b41a3a6 start + 1942
0
0
829
Nov ’23
MTLTexture streaming to app directory
For better memory usage when working with MTLTextures (editing + displaying in render passes, compute shaders, etc.) is it possible to save the texture to the app's Documents folder, and then use an UnsafeMutablePointer to access/modify the contents of the texture before displaying in a render pass? And would this be performant (i.e 60fps)? That way the texture won't be directly in memory all the time, but the contents can still be edited and displayed when needed.
1
0
788
Nov ’23
MTLCompiler crash when using SIMD permute
I have a metal compute kernel that crashes MTLCompiler when I try to load the .metallib on an iPhone SE running iOS 14.4. I get the following error: MTLCompiler: Compilation failed with XPC_ERROR_CONNECTION_INTERRUPTED on 3 try Unable to init metal: Compiler encountered an internal error By selectively commenting out code I narrowed it down to the use of SIMD permute functions. These functions are supported by the iOS/Metal version running on the device, but not by the actual hardware (according to the metal features set table). I have 2 variants of this code, one that uses the SIMD permute functions and one that doesn't. My thought was to check the GPU family in Swift, then set a function constant supportsSIMDPermute and use this to ensure the correct variation runs on the device, like this: constant bool supportsSIMDPermute [[ function_constant(1) ]]; // kernel code if(supportsSIMDPermute) { // variant of code that uses SIMD permute } else { // Variant that uses slightly slower code that does not use SIMD permute } The library compiles without complaints in Xcode, but then crashes the on-device compiler when loading the library. Is this expected behaviour?
0
0
380
Nov ’23
Scene Kit Rotation - rotating around X and Y axis only, causing Z rotation
I am trying to control the orientation of a box in Scene Kit (iOS) using gestures. I am using the translation in x and y to update the x and y rotation of the SCNNode. After a long search I have realised that x and y rotation will always lead to z rotation, thanks to this excellent post: [https://gamedev.stackexchange.com/questions/136174/im-rotating-an-object-on-two-axes-so-why-does-it-keep-twisting-around-the-thir?newreg=130c66c673f848a7be2873bf675573a9) So I am trying to get the z rotation causes, and then remove this from my object by applying the inverse quaternion however when I rotate the object 90 deg around x, and then 90 deg around Y it behaves VERY weirdly. It is almost behaving as it is in gimbal lock, but I did not think that using quaternion in the way that I am would cause gimbal lock in this way. I am sure it is something I am missing, or perhaps I am not able to remove the z rotation in this way. Thanks! I have added a video of the strange behaviour here [https://github.com/marcusraty/RotationExample/blob/main/Example.MP4) And the code example is here [https://github.com/marcusraty/RotationExample)
0
0
1k
Dec ’23
Crash when running custom train step and layers
My environment: Tensorflow: 2.14, tf-metal: 1.1, M3 Max I am working on an GAN full of residual sum and concatenation. It is trained correctly if using CPU only. However, if I enable GPU, it would cause: oc("mps_slice_1"("(mpsFileLoc): /AppleInternal/Library/BuildRoots/d615290d-668b-11ee-9734-0697ca55970a/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm":359:0)): error: 'mps.slice' op failed: length value 32 does not fit within the dimension size (33) with start value (32) /AppleInternal/Library/BuildRoots/d615290d-668b-11ee-9734-0697ca55970a/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphExecutable.mm:2133: failed assertion `Error: MLIR pass manager failed' Some customization I guess might be related to the error: tf.bitwise.bitwise_xor, tf.concat, tf.pad in custom layers numpy.random in train steps. Another debug hint I found is that the "32" is the number of channel of my models' conv layer, and change as I change the number of channel. Is there anyone know what is wrong? Thank you so much
1
1
606
Dec ’23
GPTK on Apple TV
I did not know that you can also get GPTK when you're working on an AppleTV app. I'm getting back into game programming so I booted up an app I installed on my AppleTV a few months ago and the display showed GPTK so I was able to see performance. Drew
0
0
832
Dec ’23
Create CGColorSpace from CFPropertyList
I am trying to create a custom CGColorSpace in Swift on macOS but am not sure I really understand the concepts. I want to use a custom color space called Spot1 and if I extract the spot color from a PDF I get the following: "ColorSpace<Dictionary>" = { "Cs2<Array>" = ( Separation, Spot1, DeviceCMYK, { "BitsPerSample<Integer>" = 8; "Domain<Array>" = ( 0, 1 ); "Filter<Name>" = FlateDecode; "FunctionType<Integer>" = 0; "Length<Integer>" = 526; "Range<Array>" = ( 0, 1, 0, 1, 0, 1, 0, 1 ); "Size<Array>" = ( 1024 ); } ); }; How can I create this same color space using the CGColorSpace(propertyListPlist: CFPropertyList) API func createSpot1() -> CGColorSpace? { let dict0 : NSDictionary = [ "BitsPerSample": 8, "Domain" : [0,1], "Filter" : "FlateDecode", "FunctionType" : 0, "Length" : 526, "Range" : [0,1,0,1,0,1,0,1], "Size" : [1024]] let dict : NSDictionary = [ "Cs2" : ["Separation","Spot1", "DeviceCMYK", dict0] ] let space = CGColorSpace(propertyListPlist: dict as CFPropertyList) if space == nil { DebugLog("Spot1 color space is nil!") } return space }
0
0
592
Dec ’23
Overloaded operator & device memory
Hi, In a metal shader I have a user-defined struct with a square brackets operator. This is a simplified version of it: struct MyData { float data[12]; float operator[](int i) const { return data[i]; } }; I pass a device buffer of that type in a compute kernel function: device const MyData* myDataBuffer Using the operator with a thread-space object works fine: MyData data_object = myDataBuffer[0]; float x = data_object[0]; // ok ..but trying to use it with the device-space buffer fails: float x = myDataBuffer[0][0]; // compilation error No viable overloaded operator[] for type 'const device MyData' Candidate function not viable: address space mismatch in 'this' argument ('const device MyData'), parameter type must be 'const MyData' For other operators I could define the function outside the struct and pass a reference to a device-memory object but the function for the square brackets operator can only be a member function. Am I missing something that could make the above statement compile?
2
0
416
Dec ’23