使用 Metal 框架制作煙花爆炸動畫效果:Fireworks Metal Demo

jopen 9年前發布 | 11K 次閱讀 Apple Swift開發 Fireworks Metal Demo

Overview

《使用 Metal 框架制作煙花爆炸動畫效果》作者用幾百行代碼實現了想要的效果,就是為了看看能用 Swift 做些什么,以及好玩。

This uses the "Metal" low-level 3D graphics API. Mac OSX 10.11+ is required.

Features

  • 60 FPS (2015 Mac Book)

  • Silky smooth "global time" rendering; no step-based ticks with floating point errors.

  • Calculates gravity and air drag

  • Uses alpha blending

  • Two kinds of fireworks: twinkle out and plume trail

Note
Make sure to run it in release mode for lowest CPU use (edit the scheme).

Keys

Pressspaceto pause time. Pressjandkto step time forward and backward by .016 ms.

Screen Shot

使用 Metal 框架制作煙花爆炸動畫效果:Fireworks Metal Demo

項目主頁:http://www.baiduhome.net/lib/view/home/1448115395744

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!