Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shu223/metal-sdf-examples
Shape Animation Examples using SDF with MSL (Metal Shader Language)
https://github.com/shu223/metal-sdf-examples
ios macos metal metal-shader msl sdf sdf-2d swift swiftui visionos watchos
Last synced: 2 months ago
JSON representation
Shape Animation Examples using SDF with MSL (Metal Shader Language)
- Host: GitHub
- URL: https://github.com/shu223/metal-sdf-examples
- Owner: shu223
- License: mit
- Created: 2024-03-20T21:05:35.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-06-04T06:33:00.000Z (8 months ago)
- Last Synced: 2024-11-07T19:35:51.695Z (3 months ago)
- Topics: ios, macos, metal, metal-shader, msl, sdf, sdf-2d, swift, swiftui, visionos, watchos
- Language: Metal
- Homepage:
- Size: 6.51 MB
- Stars: 63
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Metal SDF Examples
[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat
)](https://developer.apple.com/iphone/index.action)
[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat
)](https://developer.apple.com/swift)
[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat
)](http://mit-license.org)
[![Twitter](https://img.shields.io/badge/[email protected]?style=flat)](http://twitter.com/shu223)Shape Animation Examples using SDF. Shaders are written in MSL (Metal Shader Language) with SwiftUI.
![](images/MetalSDF_.gif)
## What's this?
本リポジトリは、書籍「[リアルタイムグラフィックスの数学 - GLSLではじめるシェーダプログラミング | 巴山 竜来](https://amzn.to/43tnJy7)」の [GLSLサンプル](https://github.com/yutannihilation/math_of_realtime_graphics_wgsl_version) を MSL (Metal Shader Language) で写経したものです。
主に第II部「距離が作りし世界」のSDF関連のサンプルを扱っています。
学習のため、最小限の構成にしたサンプルや、3Dだったものを2Dにしたサンプルを追加したりもしています。
## Contents
### Book examples
- 8_1_texMapping
- 8_2_lighting
- 8_6_sphere
- 8_7_rotSphere
- 9_2_morphing
- 9_3_smoothMin
- 9_4_solidTexturing![](images/9_4_solidTexturing.gif)
- 9_5_displacement
![](images/9_5.gif)
- 9_6_repeat
![](images/9_6_repeat_.gif)
- 9_7_octahedron
![](images/9_7.gif)
- 9_8_truncation
![](images/9_8.gif)
- 9_9_dist
![](images/9_9.gif)
- 9_10_norm
![](images/9_10_norm_.gif)
### Custom examples
- Circle SDF
- Union of SDFs
- 2D Morphing
- 2D Smooth Min