GithubHelp home page GithubHelp logo

sourcekim / metalbasic3d-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ooper-shlab/metalbasic3d-swift

0.0 0.0 0.0 722 KB

A translation of Apple's sample code MetalBasic3D into Swift

License: Other

Swift 47.20% Objective-C 9.58% Objective-C++ 41.90% Metal 1.33%

metalbasic3d-swift's Introduction

MetalBasic3D

MetalBasic3D renders a set of cubes using Metal and alternates their colors directly by modifying each cubes uniforms. Several parameters can be modified directly in the AAPLRenderer.mm file including the number of cubes and their size. The cubes are rendered into a helix path using spherical coordinate system to get x,y,z for the translation matrix. Each cube is renderered individually using a basic 3D phong lighting shader. The number of cubes is directly equivelent to the number of draw calls performed in the scene. In essence, the same scene can be rendered using instanced draw methods, but the purpose of this sample is to experiment with draw call count and see how it effects FPS. Note, for each frame, each cube's transformation matrix is update along with its color, therefore in each frame the sample must traverese through 2n cubes. Its possible to do even less CPU work and achieve even higher frame rates with more draw calls but this should provide a basic idea of what is possible wth Metal.

Requirements

Build

iOS 9 SDK, OSX 10.11 SDK

Runtime

iOS 9, 64 bit devices OSX 10.11

Copyright (C) 2014~2015 Apple Inc. All rights reserved.

metalbasic3d-swift's People

Contributors

ooper-shlab 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.