SwiftUI + Metal - Create special effects by building your own shaders

  Рет қаралды 29,942

Paul Hudson

Paul Hudson

Күн бұрын

Пікірлер: 55
@steveloengard5139
@steveloengard5139 11 ай бұрын
Thanks, Paul. I wrote some shaders in C++ many years ago and I've been wondering how to incorporate them into SwiftUI and Metal for macOS. This is perfect!
@twostraws
@twostraws 11 ай бұрын
Make sure and check out the Inferno repository - all contributions welcome! github.com/twostraws/Inferno
@benpearman50
@benpearman50 3 ай бұрын
Incredible tutorial! One small error at 35:46 though. When dealing with a non-square aspect ratio the correct formula for displacement is: (delta.x • delta.x) + pow((delta.y / aspectRatio), 2); You have to divide your delta Y by the aspect ratio before squaring it, otherwise the circle will be a tad on the long side ;)
@leomarcotte4294
@leomarcotte4294 11 ай бұрын
This is by far the best tutorial that can currenlty be found on the internet, thank you so much for taking the time to explain every bit of metal shaders.
@antoniopalomba5123
@antoniopalomba5123 11 ай бұрын
Thank you so much for this tutorial Paul! I was looking for some inspiration to start my Metal study.
11 ай бұрын
This was enlightening and inspiring. Btw I must have rewatched the part around 45:40 like 5 times
@kbusse
@kbusse 11 ай бұрын
Great tutorial, thanks a ton! This single video will explode the number of metal shaders used in iOS Slight real life nitpick on the flag animation: The waves run from right to left in your example, so the waves run upwind ;-)
@RBilsland
@RBilsland 11 ай бұрын
Thanks Paul, after attempting to start Metal shaders a number of time I now feel like I actually have a good base to start exploring from this time! 👍🏻
@hoagy_ytfc
@hoagy_ytfc 11 ай бұрын
Not something _every_ developer needs to know - but for those of us who do, this is a great tutorial. Thanks Paul.
@NiclasJeppsson
@NiclasJeppsson 11 ай бұрын
Love this, more Metal videos! Im currently in the process of learning Metal, and you are completely right, it’s hard. However, with the power we have in our iPhones, there’s so much creativity that can be unlocked by learning it :)
@0x0skai
@0x0skai 11 ай бұрын
Hey, Paul, i just want to say that love your person as a content creator and will to wish even more imagination in the created content, etc etc.
@Coffeeology
@Coffeeology 11 ай бұрын
Freshly baked Two Straws video. Perfect for my morning coffee.
@UnbekanntesSubjekt
@UnbekanntesSubjekt 10 ай бұрын
I must admit that you, sire, are a didactic genius. Love your instructions, and your dogs are nice, too.
@atanamvari7610
@atanamvari7610 8 ай бұрын
Just keep doing what you're doing man. So thorough
@huwrowlands
@huwrowlands 11 ай бұрын
The full sinebow effect reminds me of something used to advertise blank VHS tapes Great work!
@marcusziadev
@marcusziadev 11 ай бұрын
Watched this over 2 morning coffees. Good stuff. Shared at work
@AmitGupta-rt2gp
@AmitGupta-rt2gp 11 ай бұрын
Thank you Paul. This video is super helpful. Thank you for always putting out such rich and helpful content.
@hybridxdesign
@hybridxdesign 10 ай бұрын
I have learn so much from this turtorial, thanks.
@XeZrunner
@XeZrunner Ай бұрын
This is an incredibly useful video! Thank you.
@mylaluna
@mylaluna 11 ай бұрын
Good stuff. I have never touched shaders before and I thought only game developers care about it. Now I think I may able to use shaders on my app.
@TheZazatv
@TheZazatv 2 ай бұрын
Paul thank u so much I've been wondering how to do these crazy effects and u did show that it can be not that hard thanks! Gonna dig in Inferno etc. Btw these dogs are adorable 2 treats were not enough lol :D
@WenzelStone
@WenzelStone 6 ай бұрын
Oh God, this is mind-blowing!
@mclandeg1
@mclandeg1 4 ай бұрын
Noone is gonna talk about how cute is your dogs ❤❤
@MarkEvans5
@MarkEvans5 11 ай бұрын
😂 the windows shortcut was GOLD!!
@PEPPA_CHAN
@PEPPA_CHAN 15 күн бұрын
What’s a cute 2 hungry clouds you own❤ I have a question. While you find a hypotenuse you divide a sum of cathetes to aspectRatio. Where you get the aspectRatio? And one more question You use progress to make a blur and a zoom transitions. Where you progress it? It looks great Its the best course of metal Another was to heavy to learn for newbies but your video is cool
@theblckbird
@theblckbird 11 ай бұрын
congrats on 100K!!!
@johndoe276
@johndoe276 11 ай бұрын
Great video! Thanks, Paul (as always 😀) Question on the relative wave shader: Shouldn't it be pos.x instead of pos.y within the sin function?
@zolanihogana
@zolanihogana 11 ай бұрын
This guy goes above and beyond for us! Thank you
@MrMassmaker
@MrMassmaker 8 күн бұрын
Thanks a lot. really is inspiring.
@RyuuzakiJulio
@RyuuzakiJulio 5 ай бұрын
Really amazing effects! But the alpha 0 value for transparency doesn't show transparent if the image is on top of a colored background like a gradient or an image. How can we make it actually transparent on top of another object?
@RyuuzakiJulio
@RyuuzakiJulio 5 ай бұрын
Figured the answer: [[stitchable]] half4 recolor(float2 position, half4 color) { if (color.a > 0) { color.rgb = half3(1.0, 0.0, 0.0); } return color; }
@douglasaraujo9763
@douglasaraujo9763 10 ай бұрын
Wow, amazing!
@LyndonMaydwell
@LyndonMaydwell 11 ай бұрын
This is great! Is there a way to output values computed in a shader back to a state variable, etc?
@designckinet
@designckinet 6 ай бұрын
Really interesting!
@arkadiusz6688
@arkadiusz6688 9 ай бұрын
Wonder if there's something like shader language but for audio programming.
@sg1885
@sg1885 11 ай бұрын
amazing
@emilvladov3216
@emilvladov3216 10 ай бұрын
Adjusting the maxSampleOffset seems to get rid of the clipping at 25:19 instead of the padding
@BlaineL
@BlaineL 11 ай бұрын
Thank you done much for this Paul. Truly awesome ! Just don't know how you find the time! 👍
@simpleinterest360
@simpleinterest360 11 ай бұрын
Please make more content around computer graphics and metal
@VladimirKim-cl3rh
@VladimirKim-cl3rh 11 ай бұрын
Amazing !!!
@sabirayaz7893
@sabirayaz7893 Ай бұрын
Hi, what happened to spritekit? There is no talk of it by Apple anymore, has been deprecated?
@AlanW
@AlanW 11 ай бұрын
Is it possible to use this as the equivalent of a UIVisualEffectView? Our designers continue to insist on Figma, which has no regard for the built in blurs iOS can provide, and this would be great for getting the exact tinted gaussian blurs they keep dreaming up!
@gmebu
@gmebu 11 ай бұрын
Wow Paul
@williamsquires3070
@williamsquires3070 9 ай бұрын
(@38:35) You forgot to define ‘offset’. As a result, the code won’t compile. Error is: (on the line with “TimelineView(.animation) {tl in”) Generic parameter ‘Content’ could not be inferred Explicitly specify the generic parameters to fix this issue. because nothing defines ‘offset’ as something that can be converted to a float2. Also, the loupe() function takes 4 arguments, but only two have been passed in (“.float2(proxy.size)” and “float2(offset)”) Where’s the reference to the SwiftUI::Layer (2nd argument) and the float2 touch (4th argument)?
@thebrokenpenguin1
@thebrokenpenguin1 8 ай бұрын
It was my understanding that the position and layer automatically get passed in so we don't have to worry about those. As for the "offset" parameter, this should be the "touch" variable that he defines on the previous slide. You may find that the maxDistance and zoomFactor are too big (I certainly did), so you can experiment with making those smaller.
@Desertbynight
@Desertbynight 11 ай бұрын
I couldn't find how to make .float(elapsed) work. Tried to swap it with (time) but Generic parameter 'Content' could not be inferred
@brucknerdevilliers
@brucknerdevilliers 11 ай бұрын
Mine worked with time, but you need the @State private var start = Date.now and only one instance of 'let time = start.distance(to: tl.date)'
@swaaaapnil
@swaaaapnil 4 күн бұрын
Same, its not working for me as well.. what did you do finally?
@calmsz
@calmsz 11 ай бұрын
Thank you Professor!
@phantuananh2163
@phantuananh2163 11 ай бұрын
Awesomeeeeeeeeeeeee
@maksimums6819
@maksimums6819 11 ай бұрын
Thank you!
@olilarkin
@olilarkin 11 ай бұрын
awesome!
@michaelprenez-isbell8672
@michaelprenez-isbell8672 11 ай бұрын
works on Intel too?
@bartleby222
@bartleby222 11 ай бұрын
thanks Paul!
Making it Rain - Advanced Special Effects with SwiftUI
29:16
Paul Hudson
Рет қаралды 15 М.
5 Steps to Better SwiftUI Views
31:19
Paul Hudson
Рет қаралды 56 М.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 20 МЛН
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 29 МЛН
Will A Basketball Boat Hold My Weight?
00:30
MrBeast
Рет қаралды 145 МЛН
MAGIC TIME ​⁠@Whoispelagheya
00:28
MasomkaMagic
Рет қаралды 38 МЛН
Introduction to shaders: Learn the basics!
34:50
Barney Codes
Рет қаралды 354 М.
Best Winter Fails
22:54
FailArmy
Рет қаралды 3,3 МЛН
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 1 МЛН
Learn the Essentials of Swift in one hour
58:14
Paul Hudson
Рет қаралды 199 М.
Metal with SwiftUI: Vertex and Index Buffers
23:19
GetIntoGameDev
Рет қаралды 583
Create your first app with SwiftUI and SwiftData
2:19:51
Paul Hudson
Рет қаралды 52 М.
GPU Programming with The Metal Shading Language
23:44
2etime
Рет қаралды 18 М.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 20 МЛН