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: about 1 year 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 (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-04T06:33:00.000Z (about 2 years ago)
- Last Synced: 2025-03-26T11:11:09.347Z (about 1 year ago)
- Topics: ios, macos, metal, metal-shader, msl, sdf, sdf-2d, swift, swiftui, visionos, watchos
- Language: Metal
- Homepage:
- Size: 6.51 MB
- Stars: 68
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Metal SDF Examples
[](https://developer.apple.com/iphone/index.action)
[](https://developer.apple.com/swift)
[](http://mit-license.org)
[](http://twitter.com/shu223)
Shape Animation Examples using SDF. Shaders are written in MSL (Metal Shader Language) with SwiftUI.

## 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

- 9_5_displacement

- 9_6_repeat

- 9_7_octahedron

- 9_8_truncation

- 9_9_dist

- 9_10_norm

### Custom examples
- Circle SDF
- Union of SDFs
- 2D Morphing
- 2D Smooth Min