Scott & Mark Learn To... ShaderGlass and Vibe Coding - podcast episode cover

Scott & Mark Learn To... ShaderGlass and Vibe Coding

Apr 16, 202534 minSeason 1Ep. 14
--:--
--:--
Listen in podcast apps:
Metacast
Spotify
Youtube
RSS

Summary

Scott and Mark explore retro shaders and AI-assisted code generation. Scott demonstrates ShaderGlass, then they dive into applying HLSL shaders within Windows Terminal, using AI to create a fractal shader. They also tackle code attribution, licensing implications, and the concept of "vibe coding."

Episode description

In this episode of Scott & Mark Learn ToScott Hanselman and Mark Russinovich dive into a lively mix of tech nostalgia, AI-driven code attribution, and shader programming mishaps. Scott introduces "ShaderGlass," an app that overlays CRT-style shaders on windows, leading to a chaotic live troubleshooting session when it renders invisibly. They also explore AI-assisted code attribution, joke about their legendary Zoomit skills, and poke fun at "vibe coding" among younger developers.  

 

Takeaways:    

  • AI-generated code can now include references to original sources 
  • Scott proves that some apps can operate without Windows recognizing them 
  • How AI-generated code challenges traditional copyright laws    

   

Who are they?     

View Scott Hanselman on LinkedIn  

View Mark Russinovich on LinkedIn   

 

Watch Scott and Mark Learn on YouTube 

       

Listen to other episodes at scottandmarklearn.to  

         

Discover and follow other Microsoft podcasts at microsoft.com/podcasts   

Hosted on Acast. See acast.com/privacy for more information.

Transcript

Hey friends, if you happen to be listening to this episode in your car or on the train, I will have to tell you that this is a mostly visual episode. Mark and I are going to be writing some code. and you may not be able to really visualize everything. So I do apologize. Please do enjoy the show in audio-only mode to the best of your ability, but be sure to check us out on YouTube, where you'll be able to see all of us in our glory as we learn vibe coding.

oh by the way dude the build talk yeah it's coming together like people are getting involved like things are moving people are like is it going to rival the bathtub talk not in infamy but in quality all right I just feel like Jan and I were calling people and we're pitching it and people are like, yeah, I can see how this will be a thing. It's just we need all the little technical pieces to fit together. Is it going to be better than our asteroids talk?

It has the potential if we can figure out what comes before the finale. Jan and I are going from the finale back. Yeah. We know what the finale is. What's the finale? We can't tell you. We're recording. If we say it, then people will know. Censored B-roll. Is it censored B-roll? Yeah. This is what you can do. I guess people can lip read. You can just cut. Have a beep. Show the color bar screen.

your Visual Studio code? I use the standard BS code. I know that you use the Beyonce thing. Yeah, like a normal person. So you use just dark? I use dark modern. hot dog stand. No. Actually, you know, hot dog stand is a homage. to the original windows 3.1 desk it might have even been earlier went version of windows really um hot dog theme yeah exactly do you remember that yeah i was there i bet you can go find a screenshot of it yeah i can

I bet you know how to search for one. Oh, so it's actually acknowledging that it's a tribute. Oh, yeah, 100%. Everybody knows. Yeah, okay. Yeah, it's only you that didn't know that. I just told you about this. Yeah, that's really accessible there. That's a little intense. I'm glad somebody spent time on that. Dude, I found a thing that I swear could have been written by you.

Let me show you this thing. This is great. It was that good? It's called Shader Glass, and it is wonderful. And it's written by this lovely person here who is named... who's a retro coder. Retro, like that's their profession? That is their profession, is a retro coder. has written this thing called Shader Glass. And you go in here and you say, pick a window. So I'm going to pick Display 2. And it applies shaders over...

The window. So let me see if I can go say window. Do it on VS Code? Let's see. Oh, yeah. Yeah. It takes a second. It's a little confusing because I can't remember which display is which. Yeah, there we go. Okay, cool. So then you have to make sure that the outputs, you have to basically acknowledge your... your modes and your scales. And then there's optional aspect ratio correctness. So it takes a minute to like, there it is. So it's applying a shader over the top of that.

And it's like a video game shader, right? Like an HLSL shader. So then you can pick your shaders. like a Game Boy Pocket shader. or whatever and then here there is a pixel size there we go so now i'm taking that shader and we'll say like i want an ntsc vcr shader Are you seeing any of this? No. Oh crap. You know what this means?

If you're not seeing all the shader work, that means that the way it's doing the work is on the hardware and the way that I'm sharing the screen on this podcast is not showing it. Okay, so let's see if we can solve that. So I'm going to stop sharing. So you haven't seen any of what I just did. No, you're going to. We shall keep this in the podcast. Let's try this scenario. So now I'm going to turn color. because I'm going to switch over to OBS.

And I'm going to change my camera. So it's getting it from the hardware? So I'm going to try to pull it from the hardware. So in OBS... Oh, yeah. Let's do it. Like doing this kind of stuff live without crashing a computer. You can turn off the camera while recording, but you can't switch cameras. Okay, so stop recording.

So what I've done is I've switched to a virtual camera and now I can like move myself around and do stuff. So I'm running it through a virtual camera and then I'm going to switch to my desktop. So this is my... camera as presented through the virtual desktop. And then let's try to put the shader app over the top of it.

The problem is you can't see that. There's an app right there. Explain this, Mark, if it's a person who owns and understands the internals of Windows. There's an app right here. See the menu? Yep. But the app is invisible. Why? It's invisible even to you? No, I see it. I'm looking at it. I am moving it around. I just hit the help menu. Here's me moving around the menus of an app you can't see. Hmm. Okay.

it's on that see where it says default gpu yeah i think it's because it's writing directly on the frame buffer so windows isn't unaware of it Windows is unaware of it. But the menus, it's using Windows to display them. Yeah. But if I hit a screenshot here, I just hit Alt, Print Screen, and I'm going to open Paintbrush, put Paintbrush over here.

Yeah, you can't even see it. Yeah, because Windows doesn't see it. Oh, my goodness. This is so interesting to me. Yeah. So you need to join from your iPhone and film your screen. Can I join from my iPhone? Yeah. This is so exciting. See, this is not the show we expected, but this is good. There's an invisible app on my system here. I'm joining on my iPhone. all right can you see this yes i can see that Okay, so do you see this right here? I see the one, yeah.

That's the invisible thing. When I use ZoomIt, it disappears. Yeah, that's kind of cool. Yeah, it is. It's like the disappearing window trick. Yeah, yeah, yeah. So here, check it out. Those are the shaders. Mm-hmm. And you can pick like CRT geometry. so as i'm moving around it's applying see the vcr shader oh that's kind of cool isn't that great yeah and this vhs one that makes it look like your basement yeah

So this seemed like a Resinovich-like app, and it's cool. Yeah, and useless. Completely useless, 100% useless. But we can switch away from here. and go to my desktop the old-fashioned way. screen, retire screen here. I'm going to close that shader, so shout out to that guy. Switch over here to my command line, which you should be able to see.

here in terminal. I'm going to hold down shift. I like this one. That's pretty cool. Yeah. You like that? It's better. Okay. So I hold down settings down here. No, I mean what you're about to show, I think. Oh, okay. Let's find out. Yeah. So if you look right here where it says defaults, this is the default for any profile within Windows Terminal. And I can go down here and I could say shader. experimental pixel shader path.

Oops, sorry. I'm looking at my camera instead of looking at the actual thing. Okay, now in my dgithub folder, I keep pixel shaders, lots of them. Let's use this one here. So I'm going to shift, right-click. Where do you get these things? GitHub. So these are pixel shaders. These are HLSL things. So I go right-click, shift, copy as path. drop it in here, add double backslashes.

Okay, and then a comma, and then we'll go and open one of these to show you what it looks like. HLSL Shaders is using a C-like language to express the shader. And so these can be edited and modified and then they're dynamically compiled. So here's a pixel shader, enable curve, enable bloom, bloom strength, grayscale, tint color. I'll say tint color, Apple 2C.

so now you can see that and you should be able if you look closely see the scan line that's going yeah going through it so now if i run like midnight commander You get to see how Mark wrote most assist internals. Just like that, right? And another one would be Y-edit. Did you ever use Norton Utilities? Oh, yeah, man. Norton Commander, Norton Utilities, Norton Disk. Defrag. This is a great one here, which is Y Edit by Malcolm Smith.

So this whole thing is done here. Now, what's cool about a shader... Oh, let me just switch it to amber because there's a whole, you know, the whole tabs versus spaces, that's really, it's bigger than that. It was not about tabs versus spaces. It was about amber versus green back in the day, right? Hercules, Hercules. Well, not that people had a choice. No, you didn't. You just got what you got. Yeah. I remember just getting an amber colored thing. I had green. You had green? Okay.

So then, these pixel shaders, though, are crazy. They don't have to be just like that. You could go and say Dawn, which is another one. and switch over there so that's my background and it's using the gpu to do the work and it's all readable code. If we go back over here and look into that, that one's called don.hlsl. And next you're going to tell me you actually use none of these in practice.

It's kind of like your eyes hurt after a while. Yeah. But I do use the, like when I'm talking to the PDP-11 back here. I do use the CRT one, so I do like it retro when I'm using retro stuff. You know what I mean? If I'm coding to the PDP, then I will use- It puts you in the mood. Exactly. It gives you the vibes. This is a little obnoxious one, I think. There's a couple of other nice ones that I think are fun. But I think that the point is that sometimes I feel like people just don't do stuff.

For the heck of it. This is delightful. Why not? It's just stupid. Why not just do it? You know what I mean? And I love that that snuck its way into Windows Terminal for no other reason. Are there any fractal ones? Oh, that's a great question. Let's find out. If not, Scott. You want to do one? Yeah. Or I want AI to do one for us. Fractal HLSL terminal. That looks like I saw some fractal HLSL terminal. pixel shaders i made a crt shader fractals 2D. Those are GLSLs. I don't think those will work.

Oh, maybe not. It's our chance to be famous. Yeah, we probably could write one real quick. Yeah. I don't know if it would work. They're notoriously hard to debug. Well, here, is it one file? Yeah, it's just one single file. All right, so give the file to Claude. and say make a fractal version of this. A fractal shader based off of this. Let's see how it does. What's a good one to start with? Probably Dawn. Claude37 Thinking? Yeah. Okay.

Oh, wrong folder. Current file. I've got to clear this out. Okay. Turn this into an HLSL shader that makes fractals. You made at least two, maybe three. Well, I mean, I type out 100 words a minute, but 90 of it is backspace. Me too, actually. Yeah, you do too? Yeah. Because you know why? Because you're I.O. bound, right? Yeah. It's actually about 50% of the characters I enter are backspace. Are backspace. I respect that.

Here we go. I'll convert this Dawn shader into a fractal shader that generates beautiful fractal patterns. All right, let's see. It maintains the shader structure but replaces the core rating with fractal mathematics. This is the part where you go... I'm working on this intently. Oh, yeah. this is a new thing have you seen this this is really cool

If it finds something that it thinks might be from the web, like a Stack Overflow question, I put in a setting to get those things called out as this is where I got that from. What's the setting? I need to look it up. I can get it for you. But it's basically like an attribution setting. A lot of this stuff is just math, but some of the stuff is like, oh, the same way I would have Googled and found it in a Stack Overflow, I expect people to do the same, right?

So in this case here, yeah, here we go. Is it still going? It's almost done. You know there's a down arrow over there. Yeah, yeah, yeah. I'm just spinning the scrolling wheel. This is getting suspiciously long. No. You don't feel uncomfortable? Nope. And then it found four license types, and then it gives me the links to the different people who did the work. That's cool. It's called Code Citations.

You think that's going to work? No. You don't think so? What do we call it? Dawn? Oh, I've got to go back into the settings. Sorry, where's the freaking settings thing? So you overwrote done with this? I just overwrote it over, yeah. Failed picture shader to compile. Yeah, incorrect. No. Okay, so we'll say pixel shader failed to compile. Incorrect number of arguments to numeric type, and that's on line 86.

No, that doesn't feel right. That's not right. What? Where it's saying the error was. You think it's lying to you? the vector swizzling syntax. AI just said swizzling. Your arrows are so thick. Yeah. So if you recall, I asked the author of ZoomIt to allow Control-Shift-Scroll with the scroll wheel.

and they were happy to oblige. Actually, that is from a long, long... You didn't ask for that. That's been from forever. I think you found a bug in it. Oh, I found the one where you move it while rotating. It leaves a trace, yeah. Yeah, and it left a trace, but now that's probably more appropriate. I think you'd wait to take credit for a ZoomIt feature. No, I fully take the credit. Most of ZoomIt was my idea. By the way, I heard that there's someone that does the Azure Bootcamp.

that somebody that joined my team just did the Azure Bootcamp, you know, as an onboarding employee, onboarding to Azure. Oh, yeah. And said this. guy was a Zoomit maestro. That's a whole statement. He did the whole thing with Zoomit. He did whiteboarding and drawing and typing. The whole session. Really? That is a big statement. I'm going to connect us with this guide.

If there's a better ZoomIt person out there. From the sound of it. Seriously. This might be the world's best ZoomIt. Are we going to have to kill them? That's up to you because I think you're the one that feels threatened by this. Yeah, that's fair.

So this is an interesting point here where I'm in over my head, right? I'm only at the hello world level of writing shaders and the changing variables level of writing shaders. Someone is watching this who is a shader expert saying, it's right there, it's right there, you idiot. Right. And now this AI has pushed the limits and we've broken it. Yep. Right. So now it's just mad. What is happening there? We broke something and it got pissed off.

How do we break something? I don't know. Basically, we made the context window was too big or the claw broke on the back end. Whatever. It's just all in preview, right? Yeah. Yeah, I probably did not need a syncing model. Well, let's do that. Let's start over. Okay, so put it back. Do Clot 3.7, I'm thinking. Okay. Yeah, lots of backspacing. Making me nervous.

Shut up. All right. We need an extension that tells you how many times you hit backspace versus the backspace ratio. I had lunch, so my blood sugar is high. Down here. I've got an extension that shows your blood sugar in VS Code. Wait, so you had lunch? It's four in the afternoon. Well, I was in meetings with people like you, so that's the problem.

I let people eat lunch. I always feel like I should turn the camera off during a bite. You should. You think just noshing on a meeting is probably problematic? Yeah. Leave the mic on, though. There's a thing called vibe coding. Are you familiar with vibe coding? Yeah, yeah. In fact...

Our last episode, we talked about vibe coding. I don't know if we mentioned the term vibe coding when we did that. Yeah, but we are vibe coding, which is writing code without worrying about whether or not it works, without worrying about whether it's quality as long as it works. That's what the young people are doing. Wow. All right. Put it in GitHub. Okay. We are the authors of the Fractal Shader. I think we both get credit for this, don't we? Oh, yeah. You were involved. Yeah. Surely. Yeah.

The best part is where I save it is at HLSL, and then I go back. to dawn and i gotta control z my way back to glory because i want to make sure i didn't lose that Okay, but then here's the thing, though, and this is important. I believe this is strongly important. Well, actually, let me say this. What you've just shown is that with AI, people can go create their own cool... Oh, yeah. That's a great point. You could totally do that. I did it, and it worked.

We don't know if it's performant. We know it's correct because it works. What I need to confirm, though, if I were to ship this is my licenses, right? So here we go. dynamic zoom that changes over time, save it as a new file, apply it in Windows Terminal, similar code found with four license types. So let's shout out to Patrick Svensson here. He's been referenced three times.

So I need to look here and determine. Now, this is really important, and I think it's worth calling out. It has determined that Patrick, shout out to Patrick, wrote that before. And that's not semantically... Hey, I've written that before, too. Exactly. See, that's not semantically interesting, but the AI hasn't thought about it in that context. Actually, look at the path to where it found it. Yeah, let's do it. So it's in a shader. In a shader, he wrote.

But, you know, that comment... But Patrick got it from Martin. Yeah. But the interesting thing about that comment string, though, because I think what it found is... It found multiple hits on this file, so it's just telling you what's in this file. Right, because when you make a Windows Terminal shader, you have to say pound if defined, and then you typically make a pixel shader buffers, which is set by everyone.

Yeah. Which is pretty boilerplate. But it's important to respect these licenses and think about that stuff. So this is kind of an interesting question about the way that that search works. Because that... Those strings are going to be found in probably hundreds, if not thousands of files in GitHub. But it chose to say, I'm showing you this one. Right. But then here, we see blobs from other people where...

magic numbers start showing. And those magic numbers have very likely been copy-pasted from someone who conceived of the original magic number. So then you go, see, that one's gone. So that person deleted that one. Right. Either that or it's a hallucination. Could have hallucinated the whole thing. Here's another shader. So this one is effect 32.

That's a GLSL in the depths of a giant one from nine years ago. Yeah. Then it'll go and it'll scrape the license, but this person has not included a license. It's just out there from nine years ago. Yeah. So then, ethically and correctly, what are you able to do? But then if you look here, within each of these, this Chinese one we found from seven years ago, nine years ago. that little function there came from this Stack Overflow answer.

Then we go to that Stack Overflow answer and he says, I am the author of the second implementation. And then he gives a little bit of stuff there and then licensed it. This is good. See, this is from 2013. Yeah. Okay. So he says, this is the do what you want public license. Are you familiar with this license? I've never heard of it, but I like the name. You like the vibe, generally, of this license? Yeah. It's not an OSI-approved license. but it is compatible all right

I think we should put this under the same license. This is probably the same appropriate license. Here's an interesting thing. The U.S. Copyright Office just ruled that you can't copyright. AI-generated content. Did it really? Yep. So what does that mean? That was art generated, and I generated art.

No. Oh, good. Okay, good. That's just like a righteous thing. Yeah, look at that. So actually, we can't license. I mean, this by definition is free and open because we didn't create it. That's good. I like that. Now, here's where it gets tricky. What if we go make modifications to it ourselves? Those lines are copyrighted. The rest of it isn't. We start to enter some interesting territory when it comes to AI-assisted coding.

I don't think that the WPF license is there. I'm going to put none for now, and then I will add that WPF license. Invite me to that repo, too. Oh, yeah. You want credit? Yeah. I conceived of the whole thing. You were loosely involved early on. I conceived that this is my intellectual property, really. It's your baby. You're savage. you Still going. I love it. It's beautiful. Fractal.

fractal by cloud. Start dot. So you want to know the best way to check stuff into GitHub when you've done it like the way I've done it? How? Oh, and how do I make this public? How does this get private? Change visibility, change the public. Don't you have to go through approval process for that? It's my own personal thing. This is how real people drag it in there. Wait, what did you do? I was just literally going to just drag the file. See? There's no Git involved, baby. Yeah. Nice.

Why didn't it drag? Oh, it's there. Oh, it's there. It's down there. All right. Have Claude generate a readme. And why isn't there a co-pilot capability on the readme? Readme with all the citations and do what? What is the name of the license? We don't work blue on the show, so remember. And make sure that it includes that it's written by me and you. It was written by Claude and Scott and also Mark Russ was there. Thanks.

You were there. You were also present. If I wasn't there, this wouldn't have happened. Or it would have happened faster and it would have been more fun. That's how important I am. All right, cool. This is good. Good, good, good. So we're over here. Add a readme. Doesn't this qualify as shovelware? Yeah, pretty much. Okay. And then the license. Oh, this is an interesting one. Notice that the markdown, because it's making the markdown, and it got all confused. So then the markdown renderer...

Oh. Got bookered up. Yeah. Oh, that's nice. It actually gave me usage as well. That's not already in the readme? Did it not do that? Checking. I thought you copied the whole thing. Scroll down. No, it didn't include it. Oh, because it got screwed up? Yeah, it got screwed up, and then the whole thing fell apart from there. That's what happened. There we go. Look at that. That's pretty neat. We've created a fractal shader for terminal.

License. And I'm not going to go and have it do a license.text. I thought you were going to make one. No, but I don't want to have it generate one. I'm just going to use the one that they give you. Yeah. I just need the file. There's not the file, bro. Get started now. Here it is. Plain text file. All right, ship it. Done. That's cool. I think that's a show. That's a show right there. It's just beautiful. Yeah, it pretty much ignored everything I told it to do to insult you.

Oh, here it is. Ah, here is citations. That's what I want to include. And I didn't have to use Git once. That's always a bonus. Oh, yeah. Heck yeah. Conceived by Mark Russ. That's cool. It's just awesome. Yeah, yeah. All right. Vibe coding. There you go. Vibe coding. Mark and Scott learn vibe coding. Yeah. Chip it. Alexa, stop. Seriously. Did you hear her? Yeah. What'd she want to do? I don't know. I said vibe coding and she had opinions. Yeah.

Cool. All right. That was a great show. Like and subscribe. Get us on Hacker News, please. And give us comments. We want to hear what you like. What you like about Mark. Right. Who a better guest host could be. How we can move beyond this structure. And topics. Oh yeah, topics. What would you like Mark to learn? Or Scott, because Mark knows pretty much everything. What would you like Mark to teach Scott?

Cool. All right. That's a show right there. That was a good one. I like that one. That made me happy. Yeah, that was pretty awesome.

This transcript was generated by Metacast using AI and may contain inaccuracies. Learn more about transcripts.
For the best experience, listen in Metacast app for iOS or Android
Open in Metacast