Ray tracing with Metal. A lab to explore various ray tracing implementations with Metal.
*.swift
filesshader.msl
files with SP4 as resourceApps used on iPad
.swiftpm
files)Apps used on Winos 10
Install Cygwin with development tools (for what it's good for)
Install Swift on Windows (according to Traditional Installation section)
Create repository on GitHub (default settings)
Clone repository from GitHub
Cygwin command prompt (bash)
git clone https://github.com/otabuzzman/MetalRT
# use SSH (optional)
# git clone git://github.com/otabuzzman/MetalRT
cd MetalRT
Create SSH keys (optional)
ssh-keygen -t ed25519 -C [email protected] -f ~/.ssh/github.com.MetalRT
chmod 400 ~/.ssh/github.com.MetalRT
Swift package initialization
Winos command prompt (CMD)
cd MetalRT
swift package init
rem check
swift build
Sync package with GitHub
Cygwin command prompt (bash)
# enable SSH key usage for session
# eval "$(ssh-agent -s)"
# ssh-add ~/.ssh/github.com.MetalRT
git add -A
git push origin main
# tag required to load package with SP4
git tag -a 0.1.0 -m 'initial commit'
git push origin 0.1.0
File | Comment |
---|---|
CUIView.swift |
A SwiftUI wrapper for custom UIViews. |
MUIView.swift |
A custom MTKView. |
MUIRenderer.swift |
A boilerplate renderer to be used with MUIView. |
MHWRenderer.swift |
A Hello World renderer sub-classed from MUIRenderer. |
Wavefront.swift |
A class to read a Wavefront OBJ file. |
XPU.swift |
Types shared between CPU and GPU. |
Exception.swift |
Error exceptions. |
Extension.swift |
SwiftUI classes and protocols extensions. |
shader.msl |
Simple pass-through vertex and fragment shader functions. |
.metal
file support in SP4. Metal Shader Language (MSL) code via String
class in Swift source files (e.g. ending on .metal.swift
) ok for SP4 playgrounds and apps. The latter allows MSL files as resources. File suffixes must have three characters (e.g. .msl
). Otherwise (e.g. when using .metal
suffix) SP4 will report an unknown resource error on app open.link |
Stars: 0 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics