Sebastian Lague
Sebastian Lague
  • 282
  • 96 484 090
Coding Adventure: Rendering Text
This... is text! Let's figure out how to draw it.
Starring: Bézier curves and (so many) floating point problems.
Source code: github.com/SebLague/Text-Rendering
If you'd like to support my work (and get early access to new projects) you can do so here:
www.patreon.com/SebastianLague
ko-fi.com/sebastianlague
Resources:
developer.apple.com/fonts/TrueType-Reference-Manual/
www.microsoft.com/en-us/research/wp-content/uploads/2005/01/p1000-loop.pdf
wdobbie.com/post/gpu-text-rendering-with-vector-textures/
Font and Music Credits:
github.com/SebLague/Misc-Project-Info/blob/main/Coding-Adventures/TextRendering
Chapters
0:00:00 Intro
0:01:58 The Font Directory
0:04:27 Loading Simple Glyphs
0:10:42 Bézier Basics
0:13:42 The Character Map
0:15:47 Implied Points
0:18:11 Compound Glyphs
0:20:25 Size and Spacing
0:21:27 Rendering Glyphs with Lots of Triangles
0:22:17 Optimized Curve Rendering (Loop-Blinn)
0:28:20 A Brief Look at SDF Rendering
0:30:33 The Counting Method
0:31:48 Ray-Bézier Intersections
0:34:09 Point in Glyph Test
0:36:35 Shader Time
0:38:37 Floating Point Problems
0:41:22 The Evil Artifact Detector
0:45:36 The Closest Curve Method
0:50:48 Curve Splitting
0:54:31 Defeating the Evil Artifacts
0:58:58 Anti-Aliasing
1:02:47 Performance and Legibility
1:05:11 The Counting Method Returns
1:09:45 Outro
Переглядів: 541 489

Відео

Bad Apple but it's a Fluid Simulation
Переглядів 432 тис.4 місяці тому
I tried rendering Bad Apple inside of a particle-based fluid simulation. (I recommend watching in 4K if you can, as video compression is not overly friendly towards all the little dots!) Full resolution video download: drive.google.com/u/0/uc?id=1zTmq8M0kHYqIuf72yGJvgYuWgE8aKmU3&export=download If you'd like to learn more about the fluid simulation, take a look at this video: ua-cam.com/video/r...
I Ran a Chess Programming Tournament, Here's How it Went!
Переглядів 499 тис.5 місяців тому
Let's have a look at the creative code behind some of the bots, watch their games, and find out who will ultimately emerge victorious. If you'd like to support my work, you can do so with a recurring or one-off contribution over here: www.patreon.com/SebastianLague ko-fi.com/sebastianlague The code for all the entries, as well PGN files for all the games played in the tournament can be found ov...
Coding Adventure: Simulating Fluids
Переглядів 1,6 млн7 місяців тому
Let's try to convince a bunch of particles to behave (at least somewhat) like water. Written in C# and HLSL, and running inside the Unity engine. Source code: github.com/SebLague/Fluid-Sim If you'd like to support me in creating more videos like this, you can do so here: www.patreon.com/SebastianLague ko-fi.com/sebastianlague Resources: matthias-research.github.io/pages/publications/sca03.pdf w...
Coding Challenge Announcement: Tiny Chess Bots
Переглядів 239 тис.9 місяців тому
Hello! Here's a little coding challenge for anyone who'd like to take part: you have until October 1st to create a tiny chess bot in C# using the framework linked below. You can find more details about the challenge on that page as well. github.com/SebLague/Chess-Challenge This challenge is now over. You can find the results over here! ua-cam.com/video/Ne40a5LkK6A/v-deo.htmlsi=xVjO6WsrSNLn_AAE ...
Coding Adventure: Making a Better Chess Bot
Переглядів 663 тис.10 місяців тому
Trying to improve an old chess bot by experimenting with various interesting techniques. You can play (or watch) the bot on lichess: lichess.org/@/CodingAdventureBot/playing This is a sequel to: ua-cam.com/video/U4ogK0MIzqk/v-deo.html If you'd like to support my work (and get early access to new videos and projects) you can become a patron of the channel over here: www.patreon.com/SebastianLagu...
Answering Your Questions
Переглядів 299 тис.11 місяців тому
Let's talk about some stuff! My process for creating videos, unfinished projects, thoughts on Godot, and more. Support on Patreon: www.patreon.com/SebastianLague My (very crude) video tools: github.com/SebLague/VidTools Godot Marching Cubes Experiment: github.com/SebLague/Godot-Marching-Cubes Shapes by Freya: www.youtube.com/@Acegikmo acegikmo.com/shapes/ Music credits: github.com/SebLague/Misc...
Coding Adventure: Ray Tracing
Переглядів 1,1 млнРік тому
I tried creating a custom ray/path tracing renderer. Featuring: maths, shaders, and cats! This project was written in C# and HLSL, and uses the Unity game engine. Source Code: github.com/SebLague/Ray-Tracing Support the channel: www.patreon.com/SebastianLague Coding Adventures Playlist: ua-cam.com/play/PLFt_AvWsXl0ehjAfLFsp1PGaatzAwo0uK.html Learning Resources: raytracing.github.io blog.demofox...
Experimenting with Buses and Three-State Logic
Переглядів 569 тис.Рік тому
Let's figure out how to move data around inside our simulated computer. Featuring multiplexers, buses, and three-state logic. Series playlist: ua-cam.com/play/PLFt_AvWsXl0dPhqVsKt1Ni_46ARyiCGSq.html Simulation tool (work in progress): sebastian.itch.io/digital-logic-sim Source code: github.com/SebLague/Digital-Logic-Sim Support the channel: www.patreon.com/SebastianLague Resources and Inspirati...
Visualizing Data with 7-Segment Displays
Переглядів 1,2 млнРік тому
Displaying numbers is trickier than I expected! In this video we explore how to visualize the data inside of our simulated 4-bit registers, with the help of the double dabble algorithm and some seven segment displays. Series playlist: ua-cam.com/play/PLFt_AvWsXl0dPhqVsKt1Ni_46ARyiCGSq.html Simulation tool (work in progress): sebastian.itch.io/digital-logic-sim Source code: github.com/SebLague/D...
How to Create a Neural Network (and Train it to Identify Doodles)
Переглядів 1,8 млнРік тому
Exploring how neural networks learn by programming one from scratch in C#, and then attempting to teach it to recognize various doodles and images. Source code: github.com/SebLague/Neural-Network-Experiments Demo: sebastian.itch.io/neural-network-experiment If you'd like to support me in creating more videos (and get early access to new stuff), you can join my patreon here: www.patreon.com/Seba...
Polishing and Releasing My Tiny Geography Game
Переглядів 2,2 млн2 роки тому
I've been making some small tweaks and additions to my little geography game based on the great feedback I've received from all of you (thank you!). If you'd like to play the game, you can download it here: sebastian.itch.io/geographical-adventures The project source is over here: github.com/SebLague/Geographical-Adventures If you'd like to support my work (and get early access to new videos an...
Trying to Improve My Geography Game with More Real-World Data
Переглядів 3,7 млн2 роки тому
Continuing the geographical game journey with some performance improvements, bug fixes, graphical upgrades, and a variety of experiments. If you'd like to try running the game in its current state, there's a free download available here: sebastian.itch.io/geographical-adventures The project source code is available over here: github.com/SebLague/Geographical-Adventures If you'd like to support ...
I Tried Creating a Game Using Real-World Geographic Data
Переглядів 6 млн2 роки тому
A little experimental game I've been working on recently, where you fly around a tiny version of the world and deliver packages to various cities. Would love to hear any ideas you might have about how this could be taken further! The next episode about this project's development is now available here: ua-cam.com/video/UXD97l7ZT0w/v-deo.html The source files for this project are available here: ...
I Spent a Week Making an AI's Video Game Idea
Переглядів 3,3 млн2 роки тому
I've recently been on a streak of unfinished projects, so I decided to focus one week on actually completing something anything! I thought it would be fun to make a small game, and so I asked an AI for some ideas... If you'd like to support me in making more of these programming / game dev videos, I have a Patreon page over here: www.patreon.com/SebastianLague Project Files: github.com/SebLague...
Coding Adventure: Terraforming
Переглядів 1,4 млн2 роки тому
Coding Adventure: Terraforming
Complex Behaviour from Simple Rules: 3 Simulations
Переглядів 373 тис.3 роки тому
Complex Behaviour from Simple Rules: 3 Simulations
Coding Adventure: Ant and Slime Simulations
Переглядів 1,9 млн3 роки тому
Coding Adventure: Ant and Slime Simulations
Coding Adventure: Chess
Переглядів 3,7 млн3 роки тому
Coding Adventure: Chess
How Do Computers Remember?
Переглядів 6 млн3 роки тому
How Do Computers Remember?
Exploring How Computers Work
Переглядів 3,4 млн3 роки тому
Exploring How Computers Work
Coding Adventure: Atmosphere
Переглядів 1,1 млн3 роки тому
Coding Adventure: Atmosphere
Coding Adventure: Procedural Moons and Planets
Переглядів 1,8 млн3 роки тому
Coding Adventure: Procedural Moons and Planets
Coding Adventure: Solar System
Переглядів 835 тис.4 роки тому
Coding Adventure: Solar System
Coding Adventure: Portals
Переглядів 1,3 млн4 роки тому
Coding Adventure: Portals
My First 10 Years of Game Development
Переглядів 1,3 млн4 роки тому
My First 10 Years of Game Development
Coding Adventure: Game Idea Generator
Переглядів 850 тис.4 роки тому
Coding Adventure: Game Idea Generator
I Created a (terrible) Video Game Console
Переглядів 2,4 млн4 роки тому
I Created a (terrible) Video Game Console
Coding Adventure: Clouds
Переглядів 1,2 млн4 роки тому
Coding Adventure: Clouds
Coding Adventure: Boids
Переглядів 1,6 млн4 роки тому
Coding Adventure: Boids

КОМЕНТАРІ

  • @frank_boi
    @frank_boi 2 години тому

    But can it run crysis?

  • @romaobraz4295
    @romaobraz4295 2 години тому

    when you turned the gravity back on i almost came

  • @yungsteezy4500
    @yungsteezy4500 5 годин тому

    You could make it look like R2-D2

  • @Skeffles
    @Skeffles 6 годин тому

    Fascinating to hear how this all works. It seems like such a rabbit hole when you start looking at it.

  • @AlexJacksonSmith
    @AlexJacksonSmith 9 годин тому

    I am sorry but this is simply superb both in visuals, explanation and depth. Just magic...

  • @dvnim0045
    @dvnim0045 9 годин тому

    Im not trying to insult anyone but my prof made Computer System Organization looks tedious. But you spark my interest and made me feel like i wanna learn more about this. I guess I should just learn by myself.

  • @whatr0
    @whatr0 12 годин тому

    this is utterly hypnotic, one of the best Bad Apple's I've ever seen

  • @EliasFriberg-zq6wu
    @EliasFriberg-zq6wu 13 годин тому

    no.

  • @whatr0
    @whatr0 22 години тому

    King Gambot IV seriously reminds me of Tom7's video on bad chess engines. He basically made a prototype of that called "Suicide King" where the entire strategy was just pushing the king forward as much as possible and it worked shockingly well against unambitious players. King Gambot IV is basically that on steroids.

  • @lucaswerlemelz9502
    @lucaswerlemelz9502 День тому

    Great video and very helpful. One thing though that got me a bit confused is that you are using the concept of depth in the opposite way that it is the standard for trees. Usually, depth 0 is the root of the tree, and then you increment as you traverse each layer of child nodes. But anyway that is just a convention. Your explanation of the algorithm is 10/10.

  • @fellipec
    @fellipec День тому

    Now wonder how computers from the 80s could do that in a breeze.

  • @aubchafik5573
    @aubchafik5573 День тому

    Two layers of clouds would be great

  • @NightVision402
    @NightVision402 День тому

    This was actually worth watching unlike the other bad apple videos I watched

  • @thanatosor
    @thanatosor День тому

    16:11 - why didn't he build MUX before Register ?

  • @FelinaFaerlaingal
    @FelinaFaerlaingal День тому

    Just found this, desperately now trying to make the logic work for godot in c# I nearly got it, except for the position. the player position somehow doesn't get mirrored correctly, which throw the whole illusion off (the camera is positioned and rotate from the portal center)

  • @RealLexable
    @RealLexable День тому

    Can't await when you combine this with your world planegame or so❤

  • @RealLexable
    @RealLexable День тому

    A multiplayer mode with two planes which can crash each other like the old game "dog fight" would be amazing❤

  • @Wickie-od4pz
    @Wickie-od4pz День тому

    CAT!!

  • @algea2299
    @algea2299 День тому

    talk about fluid animations!

  • @BritishcheeModelling-jb1cs
    @BritishcheeModelling-jb1cs День тому

    I have a suggestion for the camera angle: normal flight could be with the camera at the tilted angle but then when you get to within 2500 kilometres from the target it goes to the vertical camera angle

  • @helloimbob1
    @helloimbob1 День тому

    What’s the game called ?

  • @brandonzhang5808
    @brandonzhang5808 День тому

    Bad apple could have played somewhere in the ocean sometime throughout earths history at this particle count and we can never confirm it.

  • @holdenthompson1449
    @holdenthompson1449 День тому

    I wonder why you didn't just do a distance check from the nearest point on the obstacle collider? Surely that'd eat up less processing power than several raycasts for each boid?

  • @Snipersoilder18
    @Snipersoilder18 2 дні тому

    what application are you using to create graphics for the fluids?

  • @motyd
    @motyd 2 дні тому

    Would be interesting to do something like this but with a newly created game. This way there will be new much more new ground broken and more creativity as there and no resources and history available for it.

  • @ferinzz
    @ferinzz 2 дні тому

    Every few minutes I was thinking this is a good place to stop for a part 2. now this is the spot. What about now. Then it kept going. I was lost so quick. Hanging on by a thread of the bezier curve. But eventually all I could do was sit back and admire.

  • @imagineexistance4538
    @imagineexistance4538 2 дні тому

    3:27 hey the zeta symbol could mean something really bad, watchout

  • @notlogic.the.second
    @notlogic.the.second 2 дні тому

    your videos are litterly one of the bests ive ever seen👍

  • @arshamshayan
    @arshamshayan 2 дні тому

    I love you sebastian, this video came in clutch for a project o' mine

  • @__-bm5zj
    @__-bm5zj 2 дні тому

    The jiggles and bouncing come from manually moving a collider that is part of the physics simulation. Click Player, and in the inspector click Add Component. Add Rigidbody 2D and make it Kinematic. this takes it out of the physics simulation (because we are doing the physics BY HAND and not using the physics simulation)

  • @MarkTulewicz
    @MarkTulewicz 2 дні тому

    Hehe i remember doing this for work for years... there's so much to getting it to display nicely

  • @arcengal
    @arcengal 2 дні тому

    Stunning. The best version I've seen since the sand one. I know nothing about particle physics but some of the colour effects your simulator generates are just beautiful.

  • @HiramCardona-kn7bo
    @HiramCardona-kn7bo 2 дні тому

    What do you use to test your code graphically? I'm guessing Unity, but correct me if I'm wrong. I wanna try to implement Bezier curves and test them interactively as you are.

  • @raph151515
    @raph151515 2 дні тому

    for better performance on shitty fonts, you can prerender as texture with multiple sizes (is it mipmap maybe?) swap to the right size depending on the actual glyph size. If you allocate enough resolution it will look good enough. there are known common techniques to handle the swap and the filtering. The readability in small size will be horrendous but these fonts are not made for small text anyway

  • @raph151515
    @raph151515 2 дні тому

    I thought of a way to render the fill : first determine the direction of the shape, turning right or left, total angle is 2PI or -2PI. Then render only the inside contour by going through the béziers and iterating on the bezier progress by x or y of both depending on the slope to calculate which pixel to fill. Maybe a bit more complex, but you save many pixel. Then use a common contiguous fill algorithm starting at any filled pixel indicating the direction (towards the inner part), the contiguous fill might be way faster than calculating each inside pixel against the béziers. The problem with the closest or point in shape is that every pixel even outside must be calculated. By iterating along béziers knowing which way it turns, the list of pixel is always inside and only in the contour. small sizes may create big issues because the inside contour could be outside.

  • @cruciater95
    @cruciater95 2 дні тому

    U are the fastest in the race to become my favourite channel on yt

  • @ytppp1367
    @ytppp1367 2 дні тому

    i like

  • @frendlyskrub7062
    @frendlyskrub7062 2 дні тому

    this video saved sons life, he was terminally ill until i watched this video. its a miracle thank you so much

  • @gurbuzselimboyraz6114
    @gurbuzselimboyraz6114 2 дні тому

    5:00 f words

  • @divyamgoyal7995
    @divyamgoyal7995 2 дні тому

    Man you are amazing, someday i hope to be able to make simulations like this myself. Thanks for the great video!!

  • @nachocheeselover
    @nachocheeselover 2 дні тому

    I like geography and my favorite flag is Reno, Nevada, USA. That's just a city but for country it would be Vanuatu for me.

  • @mcgamescompany
    @mcgamescompany 2 дні тому

    a brand new way of analyzing if a point is inside or outside a contour: failure cases decrease by 10 turning "== 0" to "> -1e-5": failure cases decrease by 9148

  • @yungsteezy4500
    @yungsteezy4500 2 дні тому

    I hope you succeed with the program you are using. It's a beautiful program. I'd like to use it one day

  • @yungsteezy4500
    @yungsteezy4500 2 дні тому

    I must learn all the things! I'll be back to soak up the knowledge better.

  • @OfficialScottR
    @OfficialScottR 3 дні тому

    47:45 Libreoffice Draw has the ability to convert text to polygons, which is often useful if you need to distort the text in a manner which the software doesnt usually allow. I have occasionally ran into thsi exact issue with it, so its nice to finally know why!

  • @RDD87z
    @RDD87z 3 дні тому

    i think i saw one video where you show some of the games you made through the years, and there was a game i would like to know how to make it, its like a mouse cursor dodger, where you need to try click a moving target on the screen, the target will move around and away from your mouse cursor on a precise way, dodging your cursors velocity maybe...? it didnt look like randomly moving cause that would obviously make the dodger fail by walking into your cursor x y position... i didnt find it again, can you tell me about it?

  • @adamdavis1497
    @adamdavis1497 3 дні тому

    Can't wait to see geoguessr players do any% runs of this

  • @anzhel3268
    @anzhel3268 3 дні тому

    you should look at how nothings' rasterizer v2 works he has it on his site

  • @engineer0111
    @engineer0111 3 дні тому

    Typical “ explanation “ for people who already understand everything.😕

  • @Quester2023-xp7rb
    @Quester2023-xp7rb 3 дні тому

    From country of MT.Everest==> Nepal