How to Make 3D Fractals
This is a brief introduction to how ray marching works and how it is used to generate amazing real-time 3D fractals. I uploaded the source code so you can give it a try yourself!
Source code:
github.com/HackerPoet/PySpace
Ray marching tutorial:
blog.hvidtfeldts.net/index.php...
Another really good resource (Inigo Quilez):
www.iquilezles.org/www/index.htm
He has an amazing KZread channel too:
/ @inigoquilez
If you like the things I do and want to support the channel:
/ codeparade
ko-fi.com/codeparade
Music:
/ j_c_m
JCM - Meat
JCM - Harrison
Пікірлер: 1 500
I swear this was a 20 minute video.
@MusicalArmageddon
5 жыл бұрын
i wish it was
@maija238
4 жыл бұрын
It's one of his non-euclidean tricks
@leonhardeuler9839
4 жыл бұрын
I’m confused too
@matijaaa
4 жыл бұрын
It probably happens because you learn something new, which in turn, you think more time has passed since you started watching it
@JoseRojas-hl7sn
4 жыл бұрын
Yeah I have been seen this video before and I remember other things that now they aren't here.
it's a shame that particular one isn't called "The Broccoli"
@vamshivams5029
5 жыл бұрын
Good one
@origamigek
5 жыл бұрын
My family calls that one the Wiskunde Kool (Math Cabbage), I might have started it
@mklztr4542
5 жыл бұрын
The bud
@lucavandenbrink4198
5 жыл бұрын
@@origamigek G E K O L O N I S E E R D
@Toughfey
5 жыл бұрын
What kind of broccoli u eating?
5:43 Spawn of 2B2T The Oldest Anarchy Server in Minecraft, (2165 colorized)
@dimarichmain
4 жыл бұрын
You're goddamn right
@Spiderfffun
4 жыл бұрын
WHY OK NICE GOOD... brain goes boom boom
@degiguess
4 жыл бұрын
tHe OlDeSt AnArChY sErVeR iN mInEcRaFt
@jefish4981
4 жыл бұрын
It is good idea to build fractal in minecraft
@void6306
4 жыл бұрын
@@degiguess guys it’s fit, he said the thing
"since it can often take hours to render just a few seconds" in my experience it's more like "since it can take days to render just a single frame"
@Garwinium
3 жыл бұрын
f
@user-dh8oi2mk4f
3 жыл бұрын
“since it can take years to render 1 pixel”
@Garwinium
3 жыл бұрын
@@user-dh8oi2mk4f gtx 560 moment
@user-dh8oi2mk4f
3 жыл бұрын
@@Garwinium *laughs in integrated graphics*
@miguelbaltazar7606
3 жыл бұрын
my experience is like “Since it can take 0.0001 seconds to render my 15-minute crappy videos”
I like how vsauce-y the music is
@Dan_Mak_21
5 жыл бұрын
Same. I was waiting for the "and as always, thanks for watching" at the end
@themafiagoose8338
5 жыл бұрын
reminded me of stranger things
@Xxassass1n021xX
5 жыл бұрын
Its crazy good
@alexlau5146
5 жыл бұрын
Just in case you want to hear more VSauce-y music, the composer of the usual VSauce-y music is Jake Chudnow
@alexlau5146
5 жыл бұрын
@Lenny McLennington I was thinking about Mark Watney at the moment and my brain kinda mixed the names lol
Can I just say (barely even related to this video in particular): Isn't it kinda wild how much cool shit is on KZread just free to watch? There's just so much good STUFF out there. You really can't say you're bored and have nothing to do/watch in the modern day.
@official-obama
2 жыл бұрын
you’re bored and have nothing to do/watch in the modern day.
@official-obama
2 жыл бұрын
See?
@BagaSand
2 жыл бұрын
@@official-obama that was pretty funny ngl
@trickytreyperfected1482
2 жыл бұрын
What's funny is that it's free and people complain about ads. Ads which can be skipped after 5 seconds (or 15 second ads that can't be skipped). Compare that to TV which you have to pay for and get 5 minutes of commercial for every 2 minutes of content.
@Krokoklemmee
2 жыл бұрын
@@trickytreyperfected1482 I personally wouldn't use KZread without an AdBlocker anymore though
whenever I feel smart, I just end up watching one of your videos and humble myself back to reality. You have my respect and praise
I wonder if you could make a cool music visulizer out of this
@labeurjahe4862
5 жыл бұрын
You most likely can.
@TonyKrZa
5 жыл бұрын
Yes, one good example is Aleph0 - LeaF.
@dontknowdontcare1934
5 жыл бұрын
@@TonyKrZa link?
@TonyKrZa
5 жыл бұрын
Here ya go. kzread.info/dash/bejne/aIunr5t-qLudcso.html
@junisulli7777
5 жыл бұрын
Not only that, The image itself can now reproduce a Sound of itself in a musical context! From the Creator of Mandelbulb 3D... www.skytopia.com/software/sonicphoto/index.htm
ok so no one's talking about the amazing transition in 1:41?
@NachitenRemix
2 жыл бұрын
There is no transition xd its just a jump cut
@Wudjja
2 жыл бұрын
@@NachitenRemix they are talking about when Sullivan (the blue dude) opens the door and then the wall e scene after.
@cilgin-oyuncu
2 жыл бұрын
YES . We don't talk. :)
@NachitenRemix
2 жыл бұрын
@@Wudjja aaaaahh that's true xD
"This is why you'll see raytracing used in many animated movies" >shows footage from A Bug's Life
What’s amazing is how ray tracing actually dates back to 1982-1984 when the first 3D animations utilising ray tracing were produced and at the time it took hours to render each frame and they needed custom multi million dollar graphics supercomputer mainframe systems that were developed and designed by PHD holding computer scientists so the first animations utilising the technology were primarily tech demos and experimental/abstract/artistic in nature but by 1984-85 a large majority of 3D animated TV commercials were utilising the technology. However additional advancements in 1985-87 allowed for much more complex forms of ray tracing including transparent glass textured polygons with extremely realistic limited opacity reflections that could also be colour filtered to match the colour and texture of the glass itself! Also ray marching was also experimented with as early as the late 1970s as the technique was most likely utilised for the movie Tron that came out in 1982 and the technique allowed them to create extremely large and seemingly complex repetitive scenes with a surprisingly low level of hardware power used which still was a lot at the time due to how it utilised the full capabilities of the hardware to accomplish it! :)
@nooneinparticular3370
3 жыл бұрын
Noice!
@thecianinator
2 жыл бұрын
Is that glass thing how they did the stained glass knight in Young Sherlock Holmes?
@Techno-Universal
2 жыл бұрын
@@thecianinator If that movie was from the 1980s then they would of definitely used a graphics supercomputer for the knight but I believe the scene itself was still shot on film in a studio or on location! :)
@TheSuperNova994
2 жыл бұрын
Wow that's a long comment (KZread servers go brrrrrr)
me at 3am: i need sleep My brain: How to make 3D Fractals
Lol mind-blowing you won a subscriber on this one
@babunking7401
5 жыл бұрын
Same here!
@salvat3735
4 жыл бұрын
Me too!
@hertzzgames
4 жыл бұрын
ass
@xofyu
4 жыл бұрын
@@hertzzgames ...
@ej-jz5rc
3 жыл бұрын
@@hertzzgames funniest shit i've ever seen
4:37 Was anyone else like "whoa, those water surface physics are _amazing!"_ 😅
@neillunavat
2 жыл бұрын
I knew it was real life
@pipebombmailer
2 жыл бұрын
no
@defaultdan7923
2 жыл бұрын
yup, i almost thought it was fake
fractals have such an organic feeling... specially the broccoli one
@gorlix
4 жыл бұрын
i really want to eat it ....
@sharkcraft8568
4 жыл бұрын
Fractals can be found all other the place in nature, that probably way
I was learning ray marching a while ago and made a field of spheres like in the thumbnail. Then I added a sound library so I can play mp3s and made the spheres pulsate to the beat. Just made my own 3D sound visualizer that way
5:32 Formula to make cabbage.
@user-hj1dc2wp7v
5 жыл бұрын
It's a cauliflower
@theapexsurvivor9538
5 жыл бұрын
@@user-hj1dc2wp7v agreed, it's too "smooth" for broccoli. Though I've never seen cauliflower that full of blood/ketchup...
@Robbmann67
5 жыл бұрын
@@theapexsurvivor9538 I have I dont wanna talk about it
@Toughfey
5 жыл бұрын
So that’s how vegetables grow!
@georgeruiz9211
4 жыл бұрын
@@Robbmann67 No
I love how when you have a repeating space like in the thumbnail, the object's reflections conspire with perspective to give a sort of harmonics effect. Also, your channel is fantastic (I can't even code, but it's fascinating!).
it's amazing how far ray tracing has come; now we can do it in real time.
@rogervanbommel1086
3 жыл бұрын
Yes, though the only games that support it are very simple ones, and at low frame rates(100-) e.g. Minecraft
why is this the dopest youtube channel
1:39 Wait... You're telling me that isn't real footage of an island!?
@Royalty_lew
4 жыл бұрын
Ikr!!!!
@lucaslucas191202
4 жыл бұрын
I just went to Iceland and I don't remember there being so many trees.
@MostafaAhmed-bp7ce
4 жыл бұрын
Boi u wont believe how many scenery photos that is actually being just some 3D shit
i just spent 3 hours entering random numbers and looking at cool stuff this is actually addictive
Just waiting for my graphics card to strangle me while watching this.
@catshow7078
4 жыл бұрын
Thing is,this is really easy to compute from what I grasp from the video. Your card would probably be taking you out for a drink on the house after using this kind of rendering
This video has one of the highest coolness-to-video-length ratios I’ve ever seen. so dense but so so swag, gawd this is fkn neat
Saw this and instantly knew you're the guy who made marble marcher. This is fucking amazing stuff, my man!
Dude I just got shivers running up my arms just watching this.
Wow. Looks trippy. A side note to your brief on Ray marching. Ray marching uses Signed Distance functions, a simple Euclidean distance estimator, the Euclidean norm will be calculated. Also it would be great if you had given a precursor to Recursive primitives. Great video. Big fan.
i've never actually ever seen anyone make fractals so beautiful, well done it's like this should be in some trendy game, it feels like you're in a VR computer world
This is a beautiful video! From the scenes to the audio choice, and the information make it great. I hope to see more from you in the near future!
4:14 an environment like this would actually be a torus-shaped space if it was 2D. P.S. I love your videos! This is a really cool video!
@spiritusterra5688
3 жыл бұрын
Your username, I noticed, can be thought of as a hex-code for a color. So I went to a hex-to-color converter, and found that it is a slightly more saturated version of Sky Blue. The more you know!
@spiritusterra5688
3 жыл бұрын
@@technichron I suspected that's what it was.
@ammyvl1
2 жыл бұрын
And a Clifford torus in 3D!
This might be one of the best videos I have ever seen on KZread. Thank you for the rabbit hole you are sending me down
This is a very good video. It explains ray marching in a great way that's very easy for programmers to understand. Good job!
Like calculous I'll probably come back to this video in a few years to understand it...
@jekkey
3 жыл бұрын
Understand it now?
@sophiie.837
3 жыл бұрын
@@jekkey holy shit i didn't realise the comment was years ago-
Just curious. What happens if you move the camera INSIDE the fractals?
@CodeParade
5 жыл бұрын
Some fractals have hollow chambers inside, which work fine. But if you're inside a solid area, all rays 'converge' after 0 steps at their origin, so every ray has 'hit' the same point and the whole screen is just a solid color. Interestingly, color is defined for EVERY point in 3D: surface, inside, and outside. So when you slice a fractal in half, the interior usually contains cool patterns or more fractals in the texture itself. So even though you can't see anything in 3D, the 2D slices are still really cool!
@randomcatdude
5 жыл бұрын
@@CodeParade Interesting!
@yellowcrash10
5 жыл бұрын
CodeParade Could you show this in a video? That would be very interesting to see!
@CodeParade
5 жыл бұрын
Technically, Marble Marcher allows you to do this when you move the camera inside the fractal. Here's a little animation, though that fractal doesn't have an interesting interior: codeparade.itch.io/marblemarcher/devlog/62680/update-1
@petrosadamopoulos9550
5 жыл бұрын
For some objects the distance function can allow negative values, but it's not the case for generalized distance marching. Same goes for derivatives of the distance function, which would be very useful if calculable for everything but don't integrate generically for this technique. Maybe @CodeParade uses negative distances in his little game where a transparent glass marble rolls on fractals. Using that you can march inside the marble and get refraction etc.
There's something in knowing how this was made that makes it even more satisfying to see.
Alright I didn't expect to learn about ray-tracing but Im glad I did
This is like doing the 1 of every block challenge map in Minecraft
@killingtim2
3 жыл бұрын
Except you wouldn't get the exact view in the thumbnail because there would be no block under you...
@marc278
3 жыл бұрын
@@killingtim2 thanks for reminding me this comment existed
The worst part of the video was when it ended.
Loving the mandelbroccoli set at the end!
I dont have a single idea what your talking about but I love this.
Welcome Back, Sethbling here.
I honestly didn’t really know what u were talking about, but this was interesting. I learned a lot about ray tracing and marching.
Correction: the space created by adding a modulo operator is a 3-torus, not a cylinder. Because the wrapping is happening in all 3 directions.
This is the sixth time I've watched this and I think I understand it now
This is just amazing. I've just tried out some perspective projection from 3D space to 2D space a few days ago. Not very practical yet, but still an extremely interesting topic. You've got a new subscriber.
Huh, its actually way easier to draw fractals than I thought, btw great video!
I'm really far from programming, but you tell me so interestingly that I can't tear myself away from your videos!
This is both beautiful and interesting. I had never seen or imagined such fractals.
Wow, that was brilliantly done. I'm making my own music videos with 3D fractal for youtube, using Mandelbulber software, and while I'm learning lots on the way about the fractals themselves, I never quite grasped ray marching and DE and some other aspects you went over. I read up on them but didn't quite get it, but explainations you narrated on here, with great graphics, were so clear and well done. Thank you very much! Liked and subscribed and this is on one of my playlists too! :-)
This is why I love math
@Phelan666
5 жыл бұрын
This is why I love meth
@_simon.s_
5 жыл бұрын
Says no one ever JK, I love Math
@OrangeC7
5 жыл бұрын
This is why I love math
@Kleph.
5 жыл бұрын
This is why I fear math. Wtf is going on here??? I'd much rather read about the ideas of long-dead europeans :(
@Cb-vg8gm
4 жыл бұрын
@@Phelan666 meth is fuckn godly it has me up all night straight learning everything. Shrooms too
Extremely cool! I didn't know this technique yet, I always thought it was much more complicated. Great explanation, short and to the point.
Huygens would be proud seeing that Ray Marching technique.
Man your work is sooo interesting, i could never thank you enough for sharing this with us !!!
CodeParade: ray tracing is slow and is generally only used in movies Nvidia: *laughs in RTX*
@DRKILLIE
3 жыл бұрын
AMD: *laughs at your 40 fps*
@Radical_Larry
3 жыл бұрын
RDNA2 baby
Ohhh, man... It's not easy to read the subtitles when there's so beautiful things to see at screen... You blew my mind, with this video and "Marble Marcher". Congrats, you're the Future, i think !!!! Can't wait to see it :D ♥♫
From the brilliant ending of Annihilation to this. 3D fractals are simply mesmerizing! :D
"...random colours look trippy, but maybe thats for the best" that is sitting heavy with me...
It would be really scary if I got lost in some planet with this kinds of terrain.
You are my favorite thing on the internet since a week.
Awesome production. Didn't think I'd take away so much!
The thumbnail looks like minecraft skygrid
@alexr6527
5 жыл бұрын
Ikr I looked at It and got instant nostalgia
@whythosenames
5 жыл бұрын
PAPA STALIN that is why everyone clicked on the video
Wow, it would be amazing to see a videogame where everything is made out of fractals!
Dang this made me want to learn way too much about fractals and ray marching
Finally some quality content ive been searching
one day you will realise that reality itself is fractal even the psyche is
Its wonderful when they manifest in your vision
One of the best explanations I've ever seen! Beautiful!
This is awesome and so are you! Viva código abierto!
2:35 The folks at Shadertoy typically call these _distance functions_
I thought it said “How to make 3D Friends” :(
@a-wingsgaming9162
5 жыл бұрын
I’m right there with ya. We need help 🤦🏼♂️
@Abdega
5 жыл бұрын
I’ll be a 2D friend if that helps
@maelstrom2313
5 жыл бұрын
@@metachirality I think you replied to the wrong comment.
@snowman7514
4 жыл бұрын
fRaCtAlS aRe GrEaT fRiEnDs
@apersonwithastockimage6289
4 жыл бұрын
:(
LOL Honored! Simply! Its like the DMT TRIP I EXPERIENCED. Thanks so much for the lesson young Man.
thank you so much for this, you have just saved me a lot of work. i will always credit you for this. from looking at your code i have the greatest respect.
0:08 that's the dankest weed I've ever seen
*"Open your mind, Neo."*
So much fun to watch on acid omfg.
Minecraft is literally the only game that still uses straight up quads through the ancient GL pipeline instead of triangles, fun times when you're dealing with undefined behaviour. Great video :)
The fractals remind me of some weird landscape you'd see in an existential sci-fi movie.
Please make a VR version that allows us to easily tweak the math bits and change formula. Fractals in VR are mind-blowing, but there's been only a few programs made. Only the one that allowed for serious transformations was made for the Oculus DK2 over 5 years ago.
Voice is comfortable, gives out alot of good info, explain with very simple understandable graphics. Subbed
Brilliant explanation of Ray Marching!
oh my god- This is why I fear horrorgame developers more than their own game.
1:44 CodeParade: "since it can often take hours to render just a few seconds" NVIDIA: "hold my beer"
This is such a good explanation on how this works, u earned a sub for sure
I like your voice, you are very calming. Not as dry as I'd thought you'd be, based off the subject matter.
Dr strange is jealous
@lucarodas3046
5 жыл бұрын
He needs some mirror planes.
@spyorgclubbord9520
5 жыл бұрын
Cool Guy doctor strange was inspired by breakthrough doses of psychedelics. Breakthroughs are infinitely more beautiful and mind bending.
what i understand : 0% ps: i only watch these vídeos because they're very satisfying
@maelstrom2313
5 жыл бұрын
I understood everything up until the modulus operator then my brain short circuited. Still fascinating!
It's amazing how much crazy symmetries can be seen even in the humble cubic lattice. And then you go on to spoil us with fractals!
This channel blows my mind every time. If you ever make a video game, it will probably make my brain cry, but a healthy cry.
wonder if it would be possible to make this into an addon for blender.
@digital_down
5 жыл бұрын
Raffia16th Blaze was thinking this the whole time while watching. I’m sure it’s possible.
@David-uc4hc
5 жыл бұрын
I think the guys on the Mandelbulb project have created some plugins.
@cendresaphoenix1974
4 жыл бұрын
We could have had an entire engine focusd around this but everyone got overly defensive about it
@ultimaxkom8728
4 жыл бұрын
@@cendresaphoenix1974 _"Overly defensive"?_ _"Everyone"?_ How so?
Ray marching sounds like an amazing technique. But also seems hard to code... (especially for more complex models like say a human character)
@DasAntiNaziBroetchen
5 жыл бұрын
Not harder to code, but completely impractical for any natural object like a human.
@nullvoid3545
5 жыл бұрын
just build it out of molecule like spheres, more spheres = more detale, and the minimum distance estimate = the resolution.
@DasAntiNaziBroetchen
5 жыл бұрын
@@nullvoid3545 Except that's slow as fuck as the sphere's aren't distributed on a grid or something.
Really love fractals since 1989 or so. But you added a new layer of beauty !! Thanks :-)
Hey. Your stuff is good. Just found it. Subscribed. Really like how short. Interesting. Informative they are. Not easy, well done. Please keep it up!!
It’s amazing to think that while during a strong psychedelic trip your brain can do all this rendering instantly without even thinking about any of the math it just creates these amazing fractals
I think the most disappointing part about ray marching is, that while the algorithms and techniques to calculate the distances, reflections, shadows and geometry are super efficient while looking very realistic, it's virtually impossible to create realistic looking scenes with it, at least when trying to render in real time.
This is such a good video i watched it when it first came out and ive thought about it a bunch since
I seriously wonder if we had made hardware specialized and based around ray tracing we could have real-time ray traced graphics
4:10 "into a cylindrical one" very hyper-torus-y cylinder you have there...
Thank you for your clear explanations and for sharing the links
The mandelbrot set is king!
“Unfortunately we don’t have holograms yet...” Microsoft’s Hololens team (or at least they claim): *Hold my beer*
@Alex-mq7kt
5 жыл бұрын
Unfortunately, those aren't holograms, those are AR goggles
@Zi7ar21
5 жыл бұрын
Al3x 🤫