RayMarching: Basic Operators

  Рет қаралды 36,588

The Art of Code

The Art of Code

Күн бұрын

Пікірлер: 83
@aboody006
@aboody006 5 жыл бұрын
This channel is way too underrated.
@rugosotv
@rugosotv 4 жыл бұрын
waaaaay too underrated
@sylvainlecourtois1661
@sylvainlecourtois1661 4 жыл бұрын
If more people in the world were interested in math and art creation, you would have 1 billion of subscribers 👍
@masakari6922
@masakari6922 3 жыл бұрын
I feel like its because people don't really get into actually building shaders from scratch they use programs that have all the tools built in but that only can get you so far
@aboody006
@aboody006 3 жыл бұрын
​@@masakari6922 That's true, but it's not the case in a professional setting though.
@sacredbanana
@sacredbanana 6 жыл бұрын
omg you are the best. For the longest time my ray marched shaders were suffering from artefacts, especially when using the mod operator to create many copies of an object. All I had to do was make the ray travel only a fraction of the min distance. Even though this video didn't explain how to fix my specific situation, I immediately understood it to be the solution when seeing you do it when scaling. Thank you so much
@TheArtofCodeIsCool
@TheArtofCodeIsCool 6 жыл бұрын
I'm glad to hear this helped. For your specific case, what you should really do is take into account the boundaries between cells when marching. Maybe I'll do a video about repeated distance fields in the future where I explain this.
@gijsb4708
@gijsb4708 6 жыл бұрын
Oh and as always great video! You're creating an excellent source of information next to that of Inigio Quilez'.
5 жыл бұрын
This channel is pure gold. Awesome work!
@JustYesntMan
@JustYesntMan 6 жыл бұрын
Never went home this fast before, saw the notification on my way and i just began running haha
@TheArtofCodeIsCool
@TheArtofCodeIsCool 6 жыл бұрын
Haha, awesome :)
@EricAAnderson
@EricAAnderson 6 жыл бұрын
Just stumbled upon your channel today, and it's already become a treasured resource. Thank you so much for all your time and effort!!!! Really looking forward to following along!
@TheArtofCodeIsCool
@TheArtofCodeIsCool 6 жыл бұрын
Thanks, I'm glad you get something out of it!
@sergeipavlov1117
@sergeipavlov1117 4 жыл бұрын
You are GENIUS! Where did you learn this?!?!
@prietjepruck
@prietjepruck Жыл бұрын
You make it all look so easy. Thanks for the tutorial.
@DB009
@DB009 4 жыл бұрын
Great tutorials i actually used this to make a raymarcher in shader toy then migrate it to unity. I know you have a video on that but I feel this one goes so in depth thats it worths learning to convert shaders from shader toy to unity to absorb it all and to learn from various shader toy examples. I already followed a tutorials from another channel but you go more in depth so definitely worth watching. great job man!
@bryphi77
@bryphi77 6 жыл бұрын
You sir, are the MAN!
@theobgshow
@theobgshow 4 жыл бұрын
Happy new year Martijn. Thank you for all you hard work in providing these lesons.
@TheArtofCodeIsCool
@TheArtofCodeIsCool 4 жыл бұрын
Happy New Year to you, and thanks for watching.
@kaihenthe
@kaihenthe Жыл бұрын
this is the third tutorial im following so ima sub and be a 48.9K sub
@Stenjus
@Stenjus 4 жыл бұрын
I am SOOO glad I found this... Totaly subscribed and notified. I've started writing shaders a few years ago. And I was such wondering how da fck those crazy dudes build scenes, even animated with kind of modeled objects on Shadertoy (even games like Doom) without ANY traditional 3D, keyframe animations, even without cameras..... All I saw is a bunch of lines of code, (not readable, more like yxa * cx * .5 * gf * wtf) and this MAKES this picture. That was an ABSOLUTLEY piece of magic for me, dispite I have enough hlsl and c# experience. And there we are! A MAN veeeryyy carefully and thoroughly explains part by part HOW this works. THANK YOU!
@TheArtofCodeIsCool
@TheArtofCodeIsCool 4 жыл бұрын
Aww thanks! And thanks for watching :)
@whythosenames
@whythosenames 6 жыл бұрын
Can you do 3d fractals like the menger sponge?
@TheArtofCodeIsCool
@TheArtofCodeIsCool 6 жыл бұрын
Its on the list of potential future videos :)
@playbyan1453
@playbyan1453 3 жыл бұрын
I already did mandelbulb sdf i think my mandelbulb sdf wasn't perfect cuz i got glitches
@LuukP20
@LuukP20 2 жыл бұрын
Great tutorial, helped me a lot!
@fuzzyhenry2048
@fuzzyhenry2048 4 жыл бұрын
This shows how beautiful the math is.
@NBsTube
@NBsTube 6 жыл бұрын
another excellent set of tools for everyday use! you should put your patreon link in the description box of your videos, and maybe announce it at the end of the videos, I just realized you have a patreon because I googled you. I'm sure there are some people like me that would gladly put a few bucks to have one or two of your videos a week
@TheArtofCodeIsCool
@TheArtofCodeIsCool 6 жыл бұрын
I put the link. Thanks for the tip. I'm currently aiming to have a new video every 2 to 3 weeks. Its quite a lot of work making these. Hopefully in the future I can ramp up[ the frequency.
@lewisrafter3465
@lewisrafter3465 6 жыл бұрын
Awesome video, great explanations as always!
@miro-hristov
@miro-hristov 5 жыл бұрын
I bet the Nike logo on your hoodie is the same color as your background :) Excellent explanation btw! Keep up the good work!
@TheArtofCodeIsCool
@TheArtofCodeIsCool 4 жыл бұрын
I always have to fiddle with lighting and clothing and camera settings to get the damn blue/green screen to work :)
@ooisee
@ooisee 4 жыл бұрын
I have registered thrice, to vote up this video and hit "subscribe" =) tnx a million! =)
@xamogxusx
@xamogxusx 5 жыл бұрын
Nice! Texturing/colouring tut? :D I'm hyped for new stuff
@TheArtofCodeIsCool
@TheArtofCodeIsCool 5 жыл бұрын
Its coming!
@eyupfndkl
@eyupfndkl Жыл бұрын
Hi. Is this can be use as CAD boolean operation for any shapes? if it is yes , how. Could you explain please?
@JNelson_
@JNelson_ 6 жыл бұрын
Fantastic as always!
@adriancardenosocerezo
@adriancardenosocerezo Жыл бұрын
Great!! Thanks very much.
@minimalisticbits1232
@minimalisticbits1232 6 жыл бұрын
Really nice explanations!
@kogorek1
@kogorek1 5 жыл бұрын
Awesome video! Really liked it. But I I have one question: Why are you using cryptic var names? Why not use full names? Wouldn't it be easy to understand?
@TheArtofCodeIsCool
@TheArtofCodeIsCool 5 жыл бұрын
The problem with long var names is that they take longer to type, which makes my videos even longer. I also find that when you use long names in formulas, the formulas actually get harder to read. One good thing is that a lot of the short names come up over and over again, not just in my shaders but in others as well. Here is a short list of common ones: ro = ray origin, which is usually the camera position rd = ray direction p = position, e.g. a ray marching position t = time, a value that changes over time, used to animate something d = distance, e.g. a distance to the center of a circle, or the surface of an object dS = distance to a surface dO = distance from current raymarch point to the origin a = angle i = index, or iteration, generally used in conjunction with a for-loop I hope that helps a bit. :)
@Frencylil
@Frencylil 5 жыл бұрын
Your tutorials are amazing. Thanks a lot
@徐一雄-d8o
@徐一雄-d8o 4 жыл бұрын
Thank you for your great videos! Can you do a video about Quaternion and Quaternion Rotation? Thank you very much!
@TheArtofCodeIsCool
@TheArtofCodeIsCool 4 жыл бұрын
I like the idea, but Quaternions are a mystery to me as well. So hopefully someone else can make a video that we can all learn from ;)
@josh_swanson
@josh_swanson 5 жыл бұрын
Is there any way to do Raymarching with polygonal meshes?
@TheArtofCodeIsCool
@TheArtofCodeIsCool 5 жыл бұрын
You could, and some people have done it, but it is not very practical because rasterizing triangles (rendering poly-meshes) and raymarching distance functions are two fundamentally different things.
@josh_swanson
@josh_swanson 5 жыл бұрын
@@TheArtofCodeIsCool I was afraid of that. I have seen people speculate we might eventually have models made entirely of particles or millions of small shapes instead of just triangles. Perhaps then we can use these techniques, though I also wonder how UV wrapping would work. Someone smarter than me will invent this I'm sure
@minecraftermad
@minecraftermad 5 жыл бұрын
can you make light bend around corners a little (basically whenever a distance is larger than the las distance make it tilt a little towards the object. or just make it run slightly towards the nearest object always to simulate gravitational bending or something like that) this would mimic real light. also is there a way to make the double slit experiment work?
@TheArtofCodeIsCool
@TheArtofCodeIsCool 5 жыл бұрын
I'm not sure about the double slit experiment but you can definitely bend the rays towards an object. I made a black hole shader not too long ago that bends rays: www.shadertoy.com/view/3d2SWK
@ciniss
@ciniss 3 жыл бұрын
Hi everyone! I've got a question regarding practical use of ray marching. How to you move the shapes out of shader code and just export those into the shader? What I mean is... How to use such shader in c++ code, where I have a scene and want to render the scene using ray marching? Should I use uniforms or there is another way?
@BossBeneBaby
@BossBeneBaby 4 жыл бұрын
Would it be possible to do some low resolution fluid simulation with multiple smooth sphere unions? I mean the way it looks is already really organic so this would be awesome.
@TheArtofCodeIsCool
@TheArtofCodeIsCool 4 жыл бұрын
Good question! You certainly can simulate the look of a blob of water with this method. Search ShaderToy I know there are examples.
@jimmyjimbo666
@jimmyjimbo666 5 жыл бұрын
good format :-)
@Lucas-bf4pw
@Lucas-bf4pw 5 жыл бұрын
What about glow 3d fractals? Is there another video about it?
@TheArtofCodeIsCool
@TheArtofCodeIsCool 5 жыл бұрын
No 3d fractals yet. Soon!
@osm4962
@osm4962 5 жыл бұрын
Awesome !
@1732ashish
@1732ashish 6 жыл бұрын
thanks a lot for this awesomeness
@Andrew-qc8jh
@Andrew-qc8jh Жыл бұрын
so cool
@frankeke8541
@frankeke8541 5 жыл бұрын
I tried rotation but in unity, but instead of rotating it moves up and down... shape.position.xy *= mul(shape.position.xy,Rotate(shape.rotation.z)); How do i do it ?
@TheArtofCodeIsCool
@TheArtofCodeIsCool 5 жыл бұрын
I don't know, but: shape.position.xy *= mul(shape.position.xy,Rotate(shape.rotation.z)); looks like you are multiplying twice? The mul operation by itself should be enough (so without the *=)
@frankeke8541
@frankeke8541 5 жыл бұрын
i no longer work on this project but still thanks for replying
@kalkiavatar8121
@kalkiavatar8121 6 жыл бұрын
Can we impliment ambient occlusion?
@TheArtofCodeIsCool
@TheArtofCodeIsCool 6 жыл бұрын
Yes. I'll talk about it in one of my future videos.
@icaroamorim3123
@icaroamorim3123 5 жыл бұрын
how can we set a different material for each geometry?
@TheArtofCodeIsCool
@TheArtofCodeIsCool 5 жыл бұрын
Thats a good point, I should do a video about that. In short, you would need to keep track of which object you hit. You could do this by making a function you call after the raymarching loop that gets the distances to every single object one last time (from the hit position) and spits out a different number for each object. So, if it hit the sphere it returns 1, if it hit the plane it returns 2, etc. Then in your lighting and material code you could do an if statement to do something different for each object.
@RifinTidHamar
@RifinTidHamar 5 жыл бұрын
Thank you
@rbouakaz
@rbouakaz 3 жыл бұрын
goddddddAMN !! That's cool!!!
@sc5shout
@sc5shout 5 жыл бұрын
How to mix it up with vertices set up on CPU with VBOs etc. etc. when we have no informations about number of object and also we want to give no shader direct interaction (actuall I think interaction is not a word here, but forgot the correct one) to, let's say, a guy who edits/creates a world. You know, standard situation, we have a 2D renderer, may be batched or something and we may handle 100k primitives, 60k primitives, as many as we can and as the guy needs. The guy wants to subtract one circle from another. Also collision has to work properly, normals has to be recalculated and I bet ton of other things. How to handle it?
@TheArtofCodeIsCool
@TheArtofCodeIsCool 5 жыл бұрын
Raymarching is completely different from the standard approach of rasterizing triangles. I would not recommend ray marching for making more complicated things like games.
@sc5shout
@sc5shout 5 жыл бұрын
@@TheArtofCodeIsCool I see. One more thing. You used signed distance functions to draw your scene. There is a way to draw high quality textures using signed distance field. Is it possible to use your box function to draw antialiased 2d quad on a screen?
@ismaelmagana1676
@ismaelmagana1676 6 жыл бұрын
Great ! Thankyou!
@wilsimarbr
@wilsimarbr 6 жыл бұрын
fantastic
@gijsb4708
@gijsb4708 6 жыл бұрын
I find the boolean substraction could have been better explained if you first explained boolean intersection. Because then substraction would just be the intersection of the complement!
@TheArtofCodeIsCool
@TheArtofCodeIsCool 6 жыл бұрын
Yeah you are right. Too late now though ;)
@dae2530
@dae2530 6 жыл бұрын
Volumetric clouds tutorial, please.
@TheArtofCodeIsCool
@TheArtofCodeIsCool 6 жыл бұрын
It's on the list of potential future vids.
@NikolaNevenov86
@NikolaNevenov86 5 жыл бұрын
should had added the start code.Or explained how the camera system works.
@TheArtofCodeIsCool
@TheArtofCodeIsCool 5 жыл бұрын
Its all explained in other videos. Check the links in the description.
@NikolaNevenov86
@NikolaNevenov86 5 жыл бұрын
@@TheArtofCodeIsCool Oow!...yeah... I actually went back through all your videos.Because I remember you having one and found it that way.Did't look in the description.
Shader Coding: Space GIF step-by-step
24:02
The Art of Code
Рет қаралды 26 М.
Hexagonal Tiling Explained!
29:21
The Art of Code
Рет қаралды 59 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Signed Distance Functions & Ray-Marching
24:14
Sum and Product
Рет қаралды 34 М.
Пишем свой движок 3D-графики
19:25
Onigiri
Рет қаралды 546 М.
Coding the Game of Life
30:01
The Art of Code
Рет қаралды 21 М.
I Made A Blob Shooting Game With Ray Marching
13:33
Visionary 3D
Рет қаралды 44 М.
Shader Coding: Ray Marching Tips & Tricks
31:48
The Art of Code
Рет қаралды 54 М.
How to Make 3D Fractals
7:48
CodeParade
Рет қаралды 1,7 МЛН
Ray Marching, and making 3D Worlds with Math
6:28
SimonDev
Рет қаралды 264 М.
Rounding Corners in SDFs
4:55
Inigo Quilez
Рет қаралды 73 М.
Smoothstep: The most useful function
23:56
The Art of Code
Рет қаралды 65 М.
ПОСТАРЕЛА ЗА 1 ДЕНЬ НА 20 ЛЕТ - МУЖСКОЕ ЖЕНСКОЕ
55:44
ПРИЯТНЫЙ ИЛЬДАР
Рет қаралды 677 М.
Pixel 7 и 7 Pro с Face ID - лучше iPhone 14 Pro!
21:12
Rozetked
Рет қаралды 457 М.
(✋❌)kageihina VS siajiwoo VS meosimmyyt VS oxzung#tiktok #shorts
0:12
Массаж головы пранк🤣
0:55
Kirya Kolesnikov
Рет қаралды 5 МЛН
пранк: псих сбежал из дурдома
0:53
Анна Зинкина
Рет қаралды 1,7 МЛН