Git Product home page Git Product logo

videngine's Introduction

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. Then,

  • Create a Workspace in Xcode
  • Add your project to the workspace
  • Add VidFramework project to the 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... ๐Ÿ˜…

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 (WIP).

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 ones in the commit history.

Tags:

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.

videngine's People

Contributors

endavid avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.