MSLView - Shadertoy-style SwiftUI view

Overview

MSLView

build status Swift Package Manager (SPM) compatible

SwiftUI view for Shadertoy-style MSL shaders

import MSLView

struct Constants {
    var r: Float
}

struct ContentView: View {

    @State var constants = Constants(r: 0)
    let shader = """
        struct Constants {
            float r;
        };
        fragment float4 mainImage(FragmentIn input [[stage_in]],
                               constant Constants& c,
                               constant uint2& viewSize) {
            return float4(c.r,
                          input.position.x/viewSize.x,
                          input.position.y/viewSize.y,1);
        }
        """

    var body: some View {
        VStack {
            MSLView(shader: shader, constants: constants)
            HStack {
                Slider(value: $constants.r)
                Text("\(constants.r)")
            }.padding()
        }
    }

}
You might also like...
A Swift/SwiftUI utility for caching and displaying images in SwiftUI Views

A Swift/SwiftUI utility for caching and displaying images asynchronously. Built with Swift 5.5 and works with async/await.

An image download extension of the image view written in Swift for iOS, tvOS and macOS.
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

AYImageKit is a Swift Library for Async Image Downloading, Show Name's Initials and Can View image in Separate Screen.
AYImageKit is a Swift Library for Async Image Downloading, Show Name's Initials and Can View image in Separate Screen.

AYImageKit AYImageKit is a Swift Library for Async Image Downloading. Features Async Image Downloading. Can Show Text Initials. Can have Custom Styles

Drop in GIF Collection View. Uses Tenor as default GIFs provider.
Drop in GIF Collection View. Uses Tenor as default GIFs provider.

Drop in GIF Collection View. Uses Tenor as default GIFs provider. This will allow you to easily integrate GIF image search into your app or you can use this as a GIF keyboard for your messaging needs.

A view controller for iOS that allows users to crop portions of UIImage objects
A view controller for iOS that allows users to crop portions of UIImage objects

TOCropViewController TOCropViewController is an open-source UIViewController subclass to crop out sections of UIImage objects, as well as perform basi

A custom image view that implements device motion scrolling
A custom image view that implements device motion scrolling

YXTMotionView A custom image view that implements device motion scrolling Installation CocoaPods Add the dependency to your Podfile: platform :ios pod

A simple iOS photo and video browser with grid view, captions and selections.
A simple iOS photo and video browser with grid view, captions and selections.

MWPhotoBrowser A simple iOS photo and video browser with optional grid view, captions and selections. MWPhotoBrowser can display one or more images or

A view that takes a set of images, make transition from one to another by using flipping effects.
A view that takes a set of images, make transition from one to another by using flipping effects.

CDFlipView A view that takes a set of images, make transition from one to another by using flipping effects. Demo Live Demo: https://appetize.io/app/w

Shows a list of albums initially and shows the image in detailed view.

Description : PhotosViewer Shows a list of albums initially. Selcting any album will lead to a photos list screen Tapping on any photo will display a

Owner
Audulus LLC
Audulus LLC
Rough lets you draw in a sketchy, hand-drawn-like, style.

Rough (Swift) Rough lets you draw in a sketchy, hand-drawn-like, style. It is Swift clone of Rough.js. The library defines primitives to draw lines, c

null 96 Nov 24, 2022
A apple music cover picture shadow style image library

ShadowImageView A apple music cover picture shadow style image library ShadowImageView is a iOS 10 Apple Music style image view, help you create elege

Old Donkey 794 Dec 17, 2022
A library that makes defines your style sheet like a breeze.

Atelier A library that makes defines your style sheet like a breeze. Requirements iOS 13.0+ Xcode 12.0+ Swift 5.3+ Installation You can add Atelier to

Hsieh Min Che 1 Dec 29, 2022
A custom ImageView that is used to cover the surface of other view like a scratch card, user can swipe the mulch to see the view below.

MCScratchImageView GIF Showcase Requirments iOS 8.0+ Xcode 7.2+ Swift 4.0 Installation CocoaPods pod "MCScratchImageView" Manually Just drag MCScratch

Jaylen Bian 359 Dec 17, 2022
DGLoading - A loading view that is shown at center of the current view

DGLoading A loading view that is shown at center of the current view. Requiremen

donggyu 5 Jan 26, 2022
AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.

URLImage URLImage is a SwiftUI view that displays an image downloaded from provided URL. URLImage manages downloading remote image and caching it loca

Dmytro Anokhin 1k Jan 4, 2023
PrettyBorder is a SwiftUI package for managing an customized border and background at any kind of view.

PrettyBorder Description PrettyBorder is a SwiftUI package for managing an customized border and background at any kind of view. Preview of end result

Ahmet Giray Uçar 2 Oct 13, 2021
A SwiftUI view for displaying image histograms

HistogramView A SwiftUI view for displaying image histograms. How do I use it? It's as simple as: HistogramView(image: myImage) Note: Both UIImage & N

Vasilis Akoinoglou 11 Dec 14, 2022
PrivateImage - DRM image view for UIKit and SwiftUI

SecretImage Image view with DRM protection for SwiftUI and UIKit. What? This vie

Pavel Serdziukou 27 Dec 17, 2022
SwiftUI view that download and display image from URL and displaying Activity Indicator while loading .

ViewWithActivityIndicator ViewWithActivityIndicator is a SwiftUI view that download and display image from URL and displaying Activity Indicator while

Ali Adam 28 Feb 3, 2022