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 М.
SDF (signed distance function)
7:38
CGMatter
Рет қаралды 4,6 М.
UFC 302 : Махачев VS Порье
02:54
Setanta Sports UFC
Рет қаралды 1,1 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 6 МЛН
Introduction to Ray Marching
10:57
Suboptimal Engineer
Рет қаралды 14 М.
What Are Shaders?
6:24
TheHappieCat
Рет қаралды 195 М.
Signed Distance Functions & Ray-Marching
24:14
Sum and Product
Рет қаралды 26 М.
Godot 3D Spatial Shaders: Getting Started
6:57
jitspoe
Рет қаралды 29 М.
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 907 М.
Introduction to Phong Lighting
9:44
Suboptimal Engineer
Рет қаралды 12 М.
Rounding Corners in SDFs
4:55
Inigo Quilez
Рет қаралды 69 М.
Fixing The Coding Train’s Code (Water Ripple Shader)
5:02
Barney Codes
Рет қаралды 10 М.
Elliptic Curves - Computerphile
8:42
Computerphile
Рет қаралды 535 М.
Modern OpenGL Tutorial - Compute Shaders
11:27
Victor Gordan
Рет қаралды 53 М.
What’s your charging level??
0:14
Татьяна Дука
Рет қаралды 7 МЛН
👎Главный МИНУС планшета Apple🍏
0:29
Demin's Lounge
Рет қаралды 507 М.
Huawei который почти как iPhone
0:53
Romancev768
Рет қаралды 606 М.