Introduction to Signed Distance Fields

  Рет қаралды 22,344

Suboptimal Engineer

Suboptimal Engineer

Күн бұрын

In this GLSL shader tutorial, we will go over the basics of Signed Distance Fields (SDFs). We will start by setting up a GLSL shader in VS Code with proper UV coordinates. Then we will draw a circle using the SDF function available on Inigo Quilez’s website. Finally, we will add some visuals to help us understand how the SDF works.
📖 Code - github.com/SuboptimalEng/shad...
🐦 Twitter - / suboptimaleng
💻 GitHub - github.com/SuboptimalEng
🌎 Website - suboptimaleng.com
== [ Resources ] ==
Inigo Quilez’s Articles - iquilezles.org/articles
The Book of Shaders - thebookofshaders.com
Simon Dev’s Shader Course - simondev.teachable.com
VS Code GLSL Shader Setup Guide - • How to Write GLSL Shad...
== [ Timestamps ] ==
00:00 Intro to SDFs
01:08 GLSL Shader Setup
02:03 UV Coordinates
03:23 Signed Distance Field
04:47 Exponential Shadow
06:04 Sin Waves
07:00 Smoothstep Border
== [ Tags ] ==
#suboptimal #glsl #shaders

Пікірлер: 26
@countessanise8372
@countessanise8372 Жыл бұрын
Great video. The fact that you had different commented-out lines ready to be uncommented one by one in order visualize the math, helped me quite a lot in grasping the concept. Thank you very much, Suboptimal!
@SuboptimalEng
@SuboptimalEng Жыл бұрын
Thanks Anise! It's great to hear that the technique of gradually uncommenting code helped 🔥
@Demixroxic
@Demixroxic Жыл бұрын
great video dude imma save it and come back
@Andrew-qc8jh
@Andrew-qc8jh Жыл бұрын
Really well laid out video, thanks🖖
@SuboptimalEng
@SuboptimalEng Жыл бұрын
Glad it was helpful!
@user-vr6zs6lv9j
@user-vr6zs6lv9j 8 ай бұрын
Thank you very much. The best explanation !!!
@SuboptimalEng
@SuboptimalEng 8 ай бұрын
Glad it was helpful!
@emteiks
@emteiks 4 ай бұрын
love it! more of shader gooodies needed! :)
@SuboptimalEng
@SuboptimalEng 4 ай бұрын
It’s on my roadmap for this year. Right after I learn WebGL!
@lksxxtodin5292
@lksxxtodin5292 8 ай бұрын
Thank You!
@deadbit6007
@deadbit6007 9 ай бұрын
thanks for video, do you know how make dashed outline for rounded rectangle ?
@janus798
@janus798 Жыл бұрын
This is a pretty high quality tutorial! I'm surprised there aren't any comments yet
@SuboptimalEng
@SuboptimalEng Жыл бұрын
Thanks! I'm still waiting for the day the algorithm picks up my videos 😂
@yonilaskov340
@yonilaskov340 7 ай бұрын
very nice
@suvetar
@suvetar 5 ай бұрын
Love it, thanks for your great introduction and explanation! I wonder, can this technique be used on internal corners and edges to calcular a kind of ambient occlusion? Just like the idea of messing with the parameters and seeing what happens!
@SuboptimalEng
@SuboptimalEng 5 ай бұрын
Thanks! Most of my knowledge comes from Inigo Quilez. He used the SDF to create a fake ambient occlusion for 2D shapes which is what I've shown here. Inverting the colors allowed me to turn the fake AO into a nice glow effect. I still have to learn how to do actual SSAO so I'll be looking into that next.
@Byynx
@Byynx 10 ай бұрын
You're the guy!!@
@Hobbes9
@Hobbes9 Жыл бұрын
I don't use webGL, but I'm learning openGL and I think GLSL should be the same for both(?) Came from some youtube comment, but this is pretty well made so subbed
@SuboptimalEng
@SuboptimalEng Жыл бұрын
Thanks! Yea, OpenGL uses GLSL as well so the code should be similar. I'm actually considering learning OpenGL with C++ since lots of graphics roles need this 🤓
@axMf3qTI
@axMf3qTI 5 ай бұрын
I still don't understand how the whole screen is updated without a loop or update function.
@SuboptimalEng
@SuboptimalEng 5 ай бұрын
I'd recommend watching Kishimisu's "An Introduction to Shader Art Coding" video.
@axMf3qTI
@axMf3qTI 5 ай бұрын
@@SuboptimalEng will do, thanks!
@rs-dn4ez
@rs-dn4ez 2 ай бұрын
Gpu has many cores, you can calculate each pixel in parallel.
@Lee-qj4hk
@Lee-qj4hk Жыл бұрын
+1 I really liked the way you asked for a sub and would like to be asked again :P
@regularmenthol
@regularmenthol 4 ай бұрын
The introduction 🤣
@Shortom_Boy
@Shortom_Boy Жыл бұрын
Bro can you teach how we make a perfect game It's Magic Engine? this works in mobile
What is Value Noise?
7:55
Suboptimal Engineer
Рет қаралды 3,6 М.
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 907 М.
Black Magic 🪄 by Petkit Pura Max #cat #cats
00:38
Sonyakisa8 TT
Рет қаралды 32 МЛН
ONE MORE SUBSCRIBER FOR 6 MILLION!
00:38
Horror Skunx
Рет қаралды 14 МЛН
格斗裁判暴力执法!#fighting #shorts
00:15
武林之巅
Рет қаралды 93 МЛН
Signed Distance Functions & Ray-Marching
24:14
Sum and Product
Рет қаралды 26 М.
Glyphs, shapes, fonts, signed distance fields.
6:05
Martin Donald
Рет қаралды 63 М.
Godot 3D Spatial Shaders: Getting Started
6:57
jitspoe
Рет қаралды 29 М.
SDF (signed distance function)
7:38
CGMatter
Рет қаралды 4,6 М.
An introduction to Raymarching
34:03
kishimisu
Рет қаралды 114 М.
Using noise in shaders (texture blending)
8:28
Barney Codes
Рет қаралды 8 М.
The SDF of a Box
7:28
Inigo Quilez
Рет қаралды 102 М.
What is WebGPU?
14:09
Suboptimal Engineer
Рет қаралды 56 М.
Distance Fields (Part 1) | 5-Minute Materials [UE4/UE5]
9:20
PrismaticaDev
Рет қаралды 101 М.
Mi primera placa con dios
0:12
Eyal mewing
Рет қаралды 468 М.
How much charging is in your phone right now? 📱➡️ 🔋VS 🪫
0:11
3.5.A Solar Mobile 📱 Charger
0:39
Gaming zone
Рет қаралды 320 М.
Huawei который почти как iPhone
0:53
Romancev768
Рет қаралды 606 М.