twostraws / inferno Goto Github PK
View Code? Open in Web Editor NEWMetal shaders for SwiftUI.
License: Other
Metal shaders for SwiftUI.
License: Other
Currently, the genie effect has no parameters. It always comes in and out from the top right. More configuration options should be added.
I have a naive prototype for a Shimmer effect (a la SwiftUI-Shimmer ) that I would like to add to the library.
I was able to get the shine working, but the animatable value isn't working correctly. It's pivoting at the top leading corner, and I'd like it to simply slide horizontally. If anyone, has any pointers, that would be much appreciated.
I tried to use the same "uv" method that Paul showed here.
Hey @twostraws ๐
I'd like to showcase one more effect in your repo, kind of a scan-glitch effect, here's a WIP/sneak peek:
However, while it's a great idea to showcase it in your repo, it's not necessarily a good idea to keep it there from a "distribution" point of view... It's a small piece of code that ideally should be maintained independently in a separate repo. I think that it'd be a good idea to develop it in a separate Swift package and integrate it with your repo using SPM.
What do you think?
It would be great to allow users to bring Inferno into their project using Swift Package Manager, which would mean importing the shaders and helper files ready for use. Obviously the sample project will be in the check out, but we don't actually want to include that in their build.
Is anybody else experiencing a weird behavior of the ContentPreviewSelector (i.e. selecting emoji, image, shape or symbol to apply a shader to)? Almost all of the time the segmented picker does not work on iPhone and iPad, but does work fine on macOS and visionOS. It won't change the segment when tapped on.
I can't find any problem with this picker in the code, so I'm wondering if somebody else has observed this as well?
Note: I am using Xcode 15.2 and the Simulator for iOS 17.2 and iPadOS 17.2, as well as a physical iPhone 15 Pro running iOS 17.3.1.
The goal here is to make the shaders easily to apply by wrapping them in View extensions. So, rather than writing this:
Image(systemName: "figure.walk.circle")
.font(.system(size: 300))
.colorEffect(
ShaderLibrary.checkerboard(
.color(.red),
.float(50)
)
)
Users might* instead write this:
Image(systemName: "figure.walk.circle")
.font(.system(size: 300))
.checkerboardEffect(size: 50, replacement: .red)
I've put the asterisk next to "might" because that's just a suggestion for the spelling. Other options that come to mind:
Two tips:
Thank you!
This new set of effects is really powerful, and needs some thorough documentation in the README to follow the style and contents of previous effects.
It would be great to have screenshots of each shader working right in the README, alongside their example code. You don't need to do them all in order to contribute โ even just adding one would be great!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.