All Projects → endavid → Videngine

endavid / Videngine

3D graphics for iOS using Metal and Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Videngine

Satin
A 3D Graphics Framework built on Apple's Metal
Stars: ✭ 182 (+111.63%)
Mutual labels:  shaders, metal, xcode
LuisaRender
High-Performance Multiple-Backend Renderer Based on LuisaCompute
Stars: ✭ 47 (-45.35%)
Mutual labels:  metal, gpu
ThickRedLine
Thick Red Line - drawing thick lines for SceneKit with metal shaders
Stars: ✭ 40 (-53.49%)
Mutual labels:  metal, shaders
Python Opengl
An open access book on Python, OpenGL and Scientific Visualization, Nicolas P. Rougier, 2018
Stars: ✭ 441 (+412.79%)
Mutual labels:  shaders, gpu
MetalPlayer
A video player using Metal.
Stars: ✭ 68 (-20.93%)
Mutual labels:  metal, shaders
Flocking
An example showing how to use SwiftUI, Satin, Forge and Youi to simulate birds flocking via a compute particle system (n-body).
Stars: ✭ 63 (-26.74%)
Mutual labels:  metal, shaders
Ultralight
Next-generation HTML renderer for apps and games
Stars: ✭ 3,585 (+4068.6%)
Mutual labels:  metal, gpu
Js
turbo.js - perform massive parallel computations in your browser with GPGPU.
Stars: ✭ 2,591 (+2912.79%)
Mutual labels:  shaders, gpu
Luminance Rs
Type-safe, type-level and stateless Rust graphics framework
Stars: ✭ 632 (+634.88%)
Mutual labels:  shaders, gpu
Imogen
GPU Texture Generator
Stars: ✭ 648 (+653.49%)
Mutual labels:  shaders, gpu
Toypathtracer
Toy path tracer for my own learning purposes (CPU/GPU, C++/C#, Win/Mac/Wasm, DX11/Metal, also Unity)
Stars: ✭ 753 (+775.58%)
Mutual labels:  metal, gpu
metal camera
iOS metal camera with GPU shaders.
Stars: ✭ 68 (-20.93%)
Mutual labels:  metal, shaders
RavEngine
A fast, easy to use C++20 3D game library for modern computers
Stars: ✭ 122 (+41.86%)
Mutual labels:  metal, shaders
YALCT
Yet Another Live Coding Tool - Powered by Veldrid and elbow grease
Stars: ✭ 25 (-70.93%)
Mutual labels:  metal, shaders
HelloMetal
A Suite of Metal Examples written in Swift 4.2. Highlights: Model I/O - SceneKit - OpenEXR.
Stars: ✭ 36 (-58.14%)
Mutual labels:  metal, shaders
Urde
Data interchange and engine re-implementation for games by Retro Studios | Mirror
Stars: ✭ 253 (+194.19%)
Mutual labels:  metal, xcode
Metalpetal
A GPU accelerated image and video processing framework built on Metal.
Stars: ✭ 907 (+954.65%)
Mutual labels:  metal, gpu
Methanekit
🎲 Modern 3D graphics made simple with cross-platform C++17 meta-API on top of DirectX 12 & Metal (Vulkan is coming)
Stars: ✭ 197 (+129.07%)
Mutual labels:  shaders, metal
Terrain Builder
🏔 Procedural terrain using Three.js and perlin noise, Now Accelerated by your GPU!
Stars: ✭ 228 (+165.12%)
Mutual labels:  shaders, gpu
Gfx
[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
Stars: ✭ 5,045 (+5766.28%)
Mutual labels:  metal, gpu

Vid Engine

Graphics engine written in Metal & Swift.

It's an endless work-in-progress that I use in my spare to test things. It should be usable to do basic stuff, but note that there are no plans for OpenGL ES support, and thus, both older devices and the simulators are not supported. You will need a Metal-compatible iOS device to build and run it.

Installation

Simply add this repository as a submodule in your repository,

git submodule add [email protected]:endavid/VidEngine.git VidEngine

Then,

  • Create a Workspace in Xcode
  • Add your project to the workspace
    • An easy way to start is to create a Single View App from the iOS templates (File → New → Project).
    • Under Target → Build Phases, add MetalKit.framework to Link binary with libraries section.
    • Open Main.storyboard, select the View, and select MTKView class in the Identity inspector.
  • Add VidFramework project to the workspace: Add Files → select xcodeproj file.
    • If you want to check the shaders, also add VidMetalLib to your workspace. But note that at the moment, you need to build the shader libraries from the console (see Build section).
    • I would also add a sample app to your workspace. For instance, if you want to create an AR app, add SampleAR to your workspace.
  • Select your project in Xcode, and in Target → General → Embedded Binaries, select VidFramework (it should appear if it's in your workspace). This should also add it to Linked Framework & Libraries. But if it doesn't, add it there as well. Also make sure it did add an entry in Build Phases → Embed Frameworks.

Build

Use the provided build.sh, because I can't figure out how to get the shaders in VidMetalLib to get linked to the correct location from Xcode... 😅

App Configuration

Info.plist

This engine is Metal-only, so that needs to be specified as a requirement in your Info.plist. If you are going to use AR, you will also need to include arkit to the list. Your Info.plist should have this section,

<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
<string>metal</string>
<string>arkit</string>
</array>

Overview

3D rendering

Vid Engine uses a right-handed coordinate system, with Y being the vertical direction. The camera looks to -Z by default. That means that +Z points towards the screen, and +X towards the right side of the screen. Units are given in meters by default. Therefore, both coordinate system and units match ARKit, so working with AR scene should be straightforward.

Samples

Open the VidWorkspace and you should see several samples.

SampleAR

ARKit sample app using the VidEngine.

SampleAR app

Details in these posts:

SampleColorPalette

Example of using display-P3 color space, and Self-Organizing Maps (a type of neural network).

Read these blog posts:

Also, this sample has been expanded into a full app: Palettist

SampleCornellBox

This is just the typical cornell box scene (WIP)

SampleRain

Very simple procedural 2D rain. All the updates happen in the GPU with a compute shader. You can read about it in this blog post: Metal: a Swift Introduction

Procedural 2D rain

If you need a more minimalistic example, find the rain-demo tag in git history.

SampleText

This demonstrates the support of font rendering in the 3D world using Signed-Distance Fields.

GPU Quaternions performance tests

You need to find these tags in the commit history:

instanced-spheres-quaternions
instanced-sphere-matrices
instanced-cubes-quaternions
instanced-cubes-matrices
cubes-demo-quaternions
cubes-demo-matrices

Just examples of instancing and GPU quaternions. Read about it in detail in this blog post: Performance of quaternions in the GPU

Instanced cubes

Instanced spheres

License

MIT License. Please let me know if you use this in any of your projects.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].