All Projects → ollix → Metalnanovg

ollix / Metalnanovg

Licence: mit
The Metal port of NanoVG.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Metalnanovg

Rust Skia
Safe Skia Bindings for Rust
Stars: ✭ 450 (+198.01%)
Mutual labels:  metal, graphics-library
Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+1318.54%)
Mutual labels:  graphics-library
Bgrabitmap
📜 BGRABitmap graphics library made with Lazarus (Free Pascal).
Stars: ✭ 112 (-25.83%)
Mutual labels:  graphics-library
Lv sim eclipse sdl
PC simulator project for LVGL embedded GUI Library. Recommended on Linux and Mac.
Stars: ✭ 126 (-16.56%)
Mutual labels:  graphics-library
Speculid
Easily Manage Graphics in Xcode Projects
Stars: ✭ 115 (-23.84%)
Mutual labels:  graphics-library
Pinlayout
Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable. [iOS/macOS/tvOS/CALayer]
Stars: ✭ 1,870 (+1138.41%)
Mutual labels:  ios-lib
Graphicalgorithm
🐙 🐙图形学论文实现
Stars: ✭ 108 (-28.48%)
Mutual labels:  graphics-library
Remotery
Single C file, Realtime CPU/GPU Profiler with Remote Web Viewer
Stars: ✭ 1,908 (+1163.58%)
Mutual labels:  metal
Gltfkit
An Objective-C glTF 2.0 loader and Metal-based renderer
Stars: ✭ 138 (-8.61%)
Mutual labels:  metal
Krafix
GLSL cross-compiler based on glslang and SPIRV-Cross
Stars: ✭ 124 (-17.88%)
Mutual labels:  metal
Herebedragons
A basic 3D scene implemented with various engines, frameworks or APIs.
Stars: ✭ 1,616 (+970.2%)
Mutual labels:  metal
Metal Point Cloud
A point-cloud made from 3d data with Metal.
Stars: ✭ 116 (-23.18%)
Mutual labels:  metal
Filament
Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
Stars: ✭ 13,215 (+8651.66%)
Mutual labels:  metal
Crossshader
⚔️ A tool for cross compiling shaders. Convert between GLSL, HLSL, Metal Shader Language, or older versions of GLSL.
Stars: ✭ 113 (-25.17%)
Mutual labels:  metal
Bender
Easily craft fast Neural Networks on iOS! Use TensorFlow models. Metal under the hood.
Stars: ✭ 1,728 (+1044.37%)
Mutual labels:  metal
Fna3d
FNA3D - 3D Graphics Library for FNA
Stars: ✭ 111 (-26.49%)
Mutual labels:  metal
Yudisplacementtransition
A GPU accelerated transition library makes use of displacement maps to create distortion effects.
Stars: ✭ 121 (-19.87%)
Mutual labels:  metal
Nnvm
No description or website provided.
Stars: ✭ 1,639 (+985.43%)
Mutual labels:  metal
Kaleido3d
Next Generation Renderer for Cross Platform Engine Development
Stars: ✭ 145 (-3.97%)
Mutual labels:  metal
Calendarkit
📅 Calendar for Apple platforms in Swift
Stars: ✭ 2,049 (+1256.95%)
Mutual labels:  ios-lib

MetalNanoVG

MetalNanoVG is the native Metal port of NanoVG that tries to get the most out of Apple's Graphics APIs.

Donation

If you found this project useful, please consider donating to show your support ❤️

Donate

Precautions

  • Works only on macOS 10.11+, tvOS 9.0+ and iOS 8.0+.
  • Simulator support is available since iOS 13 and requires Xcode 11+ running on macOS 10.15+.
  • Not all Apple hardwares are supported even if meets the OS requirement.
  • ARC is required.

Advantages

  • Shared buffers between CPU and GPU.
  • Various Metal states are cached whenever possible.
  • Low overheads compared to OpenGL.
  • Pre-compiled shaders. (no need to compile shaders at runtime)
  • Seamless integration with powerful Metal features such as Metal Performance Shaders.

Installation

  1. Download both NanoVG and MetalNanoVG source codes.
  2. Add both NanoVG and MetalNanoVG's src directories to the header search path.
  3. Add NanoVG's src/nanovg.c and MetalNanoVG's src/nanovg_mtl.m to the Compile Sources section in Xcode.
  4. Link the Metal and QuartzCore frameworks.
  5. For best performance, disable GPU Frame Capture and Metal API Validation as described here.

Done.

Usage

  1. Include the headers.
#include "nanovg.h"
#include "nanovg_mtl.h"
  1. Pass the CAMetalLayer object when creating the NanoVG context.
NVGcontext* ctx = nvgCreateMTL(metalLayer, NVG_ANTIALIAS | NVG_STENCIL_STROKES);

Benchmark

The following table depicts a simple CPU usage benchmark of running the NanoVG demo app on iOS devices with full Retina resolution. Both Metal and OpenGL ES2 implementations get constant 60 FPS.

iPhone 6s+ iPad Pro 12.7" (2015)
Resolution 1080 x 1920 2732 * 2048
Metal 20% 20%
OpenGL ES2 35% 33%

Example

MetalNanoVG was originally created to improve the performance of the iOS app Fog of World.

Screenshot of Fog of World

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].