Post

Replies

Boosts

Views

Activity

LowLevelMesh: Triangle Colors
I am trying to follow the documentation with the beta version of visionOS with the new realitykit LowLevelMesh construct (https://developer.apple.com/documentation/realitykit/lowlevelmesh) that draws a triangle. Although the code indicates different colors for each of the 3 vertex points, the triangle renders in white. I believe that the missing link may be a shadergraph material, but because I will be drawing millions of triangles, with colors defined at the nodes and interpolated over the area of the triangles, I want to make sure it is efficient, either with shadergraph materials or perhaps metal. I have, with an earlier version of the app I'm working on, successfully used a shadergraph material with MeshDescriptor.primatives as polygons for tetrahedrons. However, that is inefficient for more than 1,000 tetrahedrons (and crashes) so I'm trying to use the new LowLevelMesh instead (with each tetrahedron split into 4 triangles). However, I can't get very far using the example code from the documentation (that results in the white triangles), even trying to use the default shadergraph (GridMaterial) without getting quite a few error messages. I try to fix the errors with the suggested fixes and then get new ones (whack-a-mole) until it's seems to be all broken.... So in addition to my general question of shadergraph vs metal for a LowLevelMesh, a concrete example of using a shadergraph material with LowLevelMesh would be most appreciated! Thanks.
3
0
731
Jul ’24
Augmented Reality App crash, Apple vision
I have a newly installed Xcode 15 beta 2 on two machines: Apple Studio with 13.4.1, and M1 Mini with 14.0 beta. With both machines when I start a new project as an iOS Augmented Reality App and -- without doing anything else-- try to run with the Apple Vision Pro simulator, the simulation crashes. A short section of the crash report is below. I've sent these to Apple, from both machines. i'm at a loss. I can't imagine that this is the case for everyone, but I'm seeing it on both of my machines. (It also crashes when aimed at an iPad 17.0 beta simulator as well.) Does anyone have suggestions of how to get past this starting point? Thanks, in advance. Translated Report (Full Report Below) Incident Identifier: B19370C3-21F5-4AA8-A977-BFF69FD9732A CrashReporter Key: 3BA15700-B5BA-5C3B-0F30-39509BCFDE58 Hardware Model: Macmini9,1 Process: Tet5 [66050] Path: /Users/USER/Library/Developer/Xcode/UserData/Previews/Simulator Devices/3CC9EFB1-EFDA-4622-A04F-067FE72BDF40/data/Containers/Bundle/Application/54BB34F8-0D07-4ED5-9F2E-6FA61E0990B6/Tet5.app/Tet5 Identifier: com.apple-bbbbbb.Tet5 Version: 1.0 (1) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd_sim [65662] Coalition: com.apple.CoreSimulator.SimDevice.3CC9EFB1-EFDA-4622-A04F-067FE72BDF40 [84827] Responsible Process: SimulatorTrampoline [14070] Date/Time: 2023-06-30 11:39:35.9221 -0400 Launch Time: 2023-06-30 11:39:33.7148 -0400 OS Version: macOS 14.0 (23A5276g) Release Type: User Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: DYLD 4 Symbol missing Symbol not found: _$s21DeveloperToolsSupport15PreviewRegistryPAAE04makeD0AA0D0VyKFZ Referenced from: <9E12C915-D6B1-3DD3-83B8-6921502C7F73> /Users/USER/Library/Developer/Xcode/UserData/Previews/Simulator Devices/3CC9EFB1-EFDA-4622-A04F-067FE72BDF40/data/Containers/Bundle/Application/54BB34F8-0D07-4ED5-9F2E-6FA61E0990B6/Tet5.app/Tet5 Expected in: <31FB64EE-D651-3287-9607-1ED38855E80F> /Library/Developer/CoreSimulator/Volumes/xrOS_21N5165g/Library/Developer/CoreSimulator/Profiles/Runtimes/xrOS 1.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/DeveloperToolsSupport.framework/DeveloperToolsSupport (terminated at launch; ignore backtrace)
1
0
943
Jun ’23
How to use fileImporter to grab URL for later access to file contents
I've been struggling with reading the contents of a file, either on-disk or in iCloud, vs. reading contents of a file in the static bundle. I'm getting gummed-up with the correct syntax or function to call to get to a browser to choose the file. Recently, I've tried using fileImporter, and portions of that seem to work, but it also reads the file, and I just want to capture the URL and pass that on to the existing code for reading the information from the static bundle. I had a great session with the Foundations lab this afternoon in WWDC 21, but we ran out of time before we could get to the crux of the matter... I'm not sure I'm providing sufficient clarity with this post, but the apple engineer that I spoke with was very helpful and said he might be able to provide sample code to accomplish this. That would certainly be helpful for me, and maybe others. Thank you!
1
0
1.3k
Jun ’21
SwiftUI: how to interpolate colors over a triangle
I'm new to Swift, learning SwiftUI. I am writing a finite element analysis code, and at the point of trying to present the results in a "fringe plot" that fills each element with colors corresponding to strains or stresses. It's currently 2D; will be 3D in the next iteration. I am trying to figure out how to proceed for results display: ScenetKit, Metal, etc. There is an excellent example with the Metal documentation: Using a Render Pipeline to Render Primitives, that uses a 2D triangle, with colors at each corner, to interpolate colors in the area that would serve my immediate 2D needs. However, this is not SwiftUI, so very challenging for me to try to implement with my code. (I don't understand the majority of this...) Is there an easy way, maybe just Core Graphics, to do color interpolation over a triangle via SwiftUI itself? (The linear gradient method seemed promising, but I don't know how to interpolate with 3 inputs for the vertices of a triangle.) Or is there a way to use the existing example in Metal by translating into SwiftUI? Or is there a better choice? Thanks, in advance, for your suggestions!
1
0
1.8k
Aug ’20
DenseVector_Double generates warning
HelloThe documentation for DenseVector_Double includes an example as shown:var values = [2.20, 2.85, 2.79, 2.87]let vector = DenseVector_Double(count: Int32(values.count), data: &amp;values) stride(from: 0, to: vector.count, by: 1).forEach {i in print(vector.data[Int(i)])}Previously, this ran without difficulty. However recently (Swift 5.1 or 5.2?) it generates a warning: Inout expression creates a temporary pointer, but argument 'data' should be a pointer that outlives the call to 'init(count:data:)'I'm still new to Swift. Can someone explain, using this same example, how to avoid the warning?Thanks.
5
0
918
Apr ’20
DenseVector_Double
The example in the Swift documentation for DenseVector_Double:var values = [2.20, 2.85, 2.79, 2.87]let vector = DenseVector_Double(count: Int32(values.count), data: &amp;values) stride(from: 0, to: vector.count, by: 1).forEach {i in print(vector.data[Int(i)])}worked fine previously (prior to 5.2 I believe).It now has a warning:"Inout expression creates a temporary pointer, but argument 'data' should be a pointer that outlives the call to 'init(count:data:)'"What would need to be done to fix the example and avoid the error message?
3
0
1.4k
Apr ’20