{"id":25388734,"url":"https://github.com/codefiesta/vimkit","last_synced_at":"2025-10-30T16:30:40.004Z","repository":{"id":248170717,"uuid":"827996254","full_name":"codefiesta/VimKit","owner":"codefiesta","description":"Swift Package for Reading VIM Files","archived":false,"fork":false,"pushed_at":"2025-01-31T02:04:33.000Z","size":274,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T03:17:48.318Z","etag":null,"topics":["3d","3d-graphics","3d-models","bim","bim-viewer","ios","macos","metal","swift","swift-package-manager","swiftui","vision","visionos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codefiesta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-12T21:00:48.000Z","updated_at":"2025-01-21T22:58:20.000Z","dependencies_parsed_at":"2024-09-15T05:15:10.434Z","dependency_job_id":"0ece9223-17bb-4d61-bb42-fd426da3e2e5","html_url":"https://github.com/codefiesta/VimKit","commit_stats":null,"previous_names":["codefiesta/vimkit"],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codefiesta%2FVimKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codefiesta%2FVimKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codefiesta%2FVimKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codefiesta%2FVimKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codefiesta","download_url":"https://codeload.github.com/codefiesta/VimKit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239000632,"owners_count":19565824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","3d-graphics","3d-models","bim","bim-viewer","ios","macos","metal","swift","swift-package-manager","swiftui","vision","visionos"],"created_at":"2025-02-15T13:38:31.251Z","updated_at":"2025-10-30T16:30:39.998Z","avatar_url":"https://github.com/codefiesta.png","language":"Swift","readme":"![Build](https://github.com/codefiesta/VimKit/actions/workflows/swift.yml/badge.svg)\n![Xcode 26.0+](https://img.shields.io/badge/Xcode-26.0%2B-gold.svg)\n![Swift 6.1+](https://img.shields.io/badge/Swift-6.1%2B-tomato.svg)\n![iOS 18.0+](https://img.shields.io/badge/iOS-18.0%2B-crimson.svg)\n![visionOS 2.0+](https://img.shields.io/badge/visionOS-2.0%2B-magenta.svg)\n![macOS 15.0+](https://img.shields.io/badge/macOS-15.0%2B-skyblue.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-indigo.svg)](https://opensource.org/licenses/MIT)\n\n# VimKit\nVimKit is an open-source [swift package](https://developer.apple.com/documentation/xcode/swift-packages) for reading and rendering [VIM](https://www.vimaec.com/) files on Apple platforms ([iOS](https://developer.apple.com/ios/), [macOS](https://developer.apple.com/macos/), [visionOS](https://developer.apple.com/visionos/)) with [Metal](https://developer.apple.com/metal/).\n\nhttps://github.com/user-attachments/assets/fbf67c6d-5195-43ba-83e6-1201a992c0de\n\n\n## Overview\nThe VimKit package is broken down into 3 seperate modules ([VimKit](#vimkit-1), [VimKitCompositor](#vimkitcompositor), [VimKitShaders](#vimkitshaders)). \n\n[VIM](https://github.com/vimaec/vim) files are composed of [BFAST](https://github.com/vimaec/bfast) containers that provide the necessary [geometry](https://github.com/vimaec/vim#geometry-buffer), [assets](https://github.com/vimaec/vim/#assets-buffer), [entities](https://github.com/vimaec/vim#entities-buffer), and [strings](https://github.com/vimaec/vim#strings-buffer) buffers used to render and interrogate all of the 3D instances contained in a file. \n\nAlthough it is possible to render each [Instance](https://github.com/codefiesta/VimKit/blob/main/Sources/VimKitShaders/include/ShaderTypes.h#L109) individually, VimKit leverages instancing to render all Instance's that share the same Mesh in a single [draw](https://github.com/codefiesta/VimKit/blob/main/Sources/VimKit/Renderer/Renderer%2BDrawing.swift) call.\n\n[Geometry.swift](https://github.com/codefiesta/VimKit/blob/main/Sources/VimKit/Geometry.swift) and [ShaderTypes.h](https://github.com/codefiesta/VimKit/blob/main/Sources/VimKitShaders/include/ShaderTypes.h) are the best sources to understand the details of how the geometry, positions, indices and data structures used for rendering are organized.\n\n## VimKit\nProvides the core library for reading and [rendering](https://github.com/codefiesta/VimKit/blob/main/Sources/VimKit/Renderer/VimRenderer.swift) VIM files on [macOS](https://developer.apple.com/macos/) and [iOS](https://developer.apple.com/ios/).\n\n### References\n*  [https://github.com/vimaec/vim-format](https://github.com/vimaec/vim-format)\n*  [https://github.com/vimaec/bfast](https://github.com/vimaec/bfast)\n*  [https://github.com/vimaec/g3d](https://github.com/vimaec/g3d)\n\n\n## VimKitCompositor\nProvides the core library for rendering VIM files on [visionOS](https://developer.apple.com/visionos/) (Apple Vision Pro) using [CompositorServices](https://developer.apple.com/documentation/compositorservices).\n\n### References\n*  [WWDC 2023 - Discover Metal for immersive apps](https://developer.apple.com/videos/play/wwdc2023/10089/)\n*  [WWDC 2023 - Meet ARKit for spatial computing](https://developer.apple.com/videos/play/wwdc2023/10082)\n*  [Drawing fully immersive content using Metal](https://developer.apple.com/documentation/compositorservices/drawing_fully_immersive_content_using_metal)\n\n## VimKitShaders\nProvides the core Metal C++14 Library that provides types and enums shared between [Metal Shaders](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf) and Swift.\n\n## Direct and Indirect Rendering\nVimKit supports both Direct Render Passes (draw commands issued on the CPU) and Indirect Render Passes (draw commands issued on the GPU via [Indirect Command Buffers](https://developer.apple.com/documentation/metal/indirect_command_encoding/encoding_indirect_command_buffers_on_the_gpu)).\n\n### Indirect Render Passes (GPU Driven Rendering)\nVimKit provides the ability to perform GPU driven rendering by default on all Apple devices with GPU families of `.apple4` (Apple A11) or greater. If the device supports  *indirect command buffers* (ICB), the render commands are generated on the GPU to maximize parallelization. The following devices support Indirect Command Buffers:\n\n- A Mac from mid-2016 and later with macOS 11 and later\n- An iPad with A11 Bionic and later using iPadOS 14.1 and later\n- An iOS device with A11 Bionic and later using iOS 14.1 and later\n\nIn order to maximize GPU and CPU parallelization, the Indirect Render Pass will dispatch a thread grid size of `width x height` where the width == the maximum number of submeshes a mesh can contain and height == the number of instanced meshes the geometry contains. [Metal automaticaly calculates the number of threadgroups](https://developer.apple.com/documentation/metal/compute_passes/calculating_threadgroup_and_grid_sizes) and provides nonuniform threadgroups if the grid size isn’t a multiple of the threadgroup size.\n\n[Indirect.metal](https://github.com/codefiesta/VimKit/blob/main/Sources/VimKitShaders/Resources/Indirect.metal#L256) and [RenderPass+Indirect.swift](https://github.com/codefiesta/VimKit/blob/main/Sources/VimKit/Renderer/RenderPass%2BIndirect.swift) are the best resources to understand how the kernel code issues rendering instructions on the GPU.\n\n## VisionOS Usage\nThe following is an example of the simplest usage of rendering a VIM file on visionOS:\n\n```swift\nimport CompositorServices\nimport SwiftUI\nimport VimKit\nimport VimKitCompositor\n\n/// The id of our immersive space\nfileprivate let immersiveSpaceId = \"VimImmersiveSpace\"\n\n@main\nstruct VimViewerApp: App {\n\n    /// Sample Vim File\n    let vim = Vim(URL(string: \"https://vim02.azureedge.net/samples/residence.v1.2.75.vim\")!)\n\n    /// Holds the composite layer configuration\n    let configuration = VimCompositorLayerConfiguration()\n\n    /// The ARKit DataProvider context\n    let dataProviderContext = DataProviderContext()\n\n    /// Build the scene body\n    var body: some Scene {\n\n        // Displays a 2D Window\n        WindowGroup {\n            Button {\n                Task {\n                    // Launch the immersive space\n                    await openImmersiveSpace(id: immersiveSpaceId)\n                }\n            } label: {\n                Text(\"Show Immersive Space\")\n            }\n            .task {\n                // Start the ARKit HandTracking\n                await dataProviderContext.start()\n            }\n        }\n\n        // Displays the fully immersive 3D scene\n        ImmersiveSpace(id: immersiveSpaceId) {\n            VimImmersiveSpaceContent(vim: vim,\n                                     configuration: configuration,\n                                     dataProviderContext: dataProviderContext)\n        }\n        .immersionStyle(selection: .constant(.full), in: .full)\n    }\n} \n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodefiesta%2Fvimkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodefiesta%2Fvimkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodefiesta%2Fvimkit/lists"}