Remaking the Black Hole Shader from Outer Wilds! | Unity Shader

  Рет қаралды 24,488

Quontyn Tech Art

Quontyn Tech Art

Күн бұрын

Пікірлер: 83
@jackovall1127
@jackovall1127 Жыл бұрын
This is such a high quality video! It's a shame this hasn't gotten more attention! Please keep up the amazing work!
@JohnCorby147
@JohnCorby147 Жыл бұрын
I've been modding Outer Wilds for about 2 years now, and the game has basically inspired me to become a (very amateur) tech artist. I've been wondering how they accomplished this effect for ages! I tried staring at the decompiled singularity code and just couldn't wrap my head around how they distorted the screen, but it makes sense its so deceptively simple given said decompiled code is surprisingly short. tldr thank you so much for making this video (and greetings from the ow modding community)
@chsovi7164
@chsovi7164 Жыл бұрын
I've always found it hard to imagine the output of a fragment shader cause it's hard to imagine the output for enough pixels to form an accurate image of the final product
@LeLeDeLaGeo
@LeLeDeLaGeo 3 ай бұрын
im really interested in your modding, i am a game dev and figure out how they make outer wilds is somehow became an opsession to me X), could you give me some link of your work ?
@LeLeDeLaGeo
@LeLeDeLaGeo 3 ай бұрын
Btw If that can motivate you yo go forward, i have remade the black hole of the video, and it’s technically not the same at all, just go close enough and look arround, it’s really different, i wonder if they used some kind of fullscreen shader, or maybe they somehow « tiled » the screen ?
@Taelo
@Taelo 11 ай бұрын
Since I'm a huge nerd, photons themselves aren't bending around black holes. It's spacetime itself being bent. Light doesn't curve unless it's refracted by something because it has no mass. It travels straight through space, but that space is curved so intensely by the gravity of black holes that light will appear to curve around them, which is what we see as gravitational lensing. Nitpicking aside, fantastic video.
@SephoWepho
@SephoWepho Жыл бұрын
Man, this makes me wish I knew more about shaders, haha. I've been using Unity for about almost 4 years now, but I'm only just learning basic shader graph functionality -- hopefully I'll be back here in a year or two with enough knowledge to replicate this! Either way, this is an amazingly produced video, I loved your visualizations for what couldn't be shown within Unity. You wouldn't believe how happy I was to see that someone remade this effect, I always wondered how it was put together! :3
@noobcoodoocoo
@noobcoodoocoo Жыл бұрын
The one thing I usually got stuck at is drawing objects near the camera, but far from the black hole. eg: if you're having a black hole sunrise the mountains show up in the distortion clear as day, which doesn't make that much sense. Real cool vid can't wait for more, definitely taking some notes from this one ;)
@possebao4217
@possebao4217 Жыл бұрын
but since the mountains aren't between the black hole and the observer, the beams that hit it will not be affected by the black hole, the light emitted from a light bulb would hit it and get to your eyes even if the whole horizon was one huge black hole
@SunroseStudios
@SunroseStudios 11 ай бұрын
i wonder if scaling it with the depth buffer would help somehow
@thalianero1071
@thalianero1071 11 ай бұрын
Outer wilds didn’t solve this problem, which is why your ship’s controls appear in the distortion
@noobcoodoocoo
@noobcoodoocoo 11 ай бұрын
@@thalianero1071 huh never noticed that, good to know it's not just me
@faultboy
@faultboy Жыл бұрын
Falling into this hole in the game for the first time and appearing somewhere totally different was pure horror and terror for me... Comparable to getting dragged hundred meter into the ocean depth.
@Majima_Nowhere
@Majima_Nowhere Жыл бұрын
I have no knowledge about any graphics tech. I don't know what a shader is even defined as, but I know that shaders are magic and that everything is a shader. Water? Shader. Fire? Shader. Black hole? Shader. Ground tesselation? Definitely a shader. Reflections? Raytracing and also shader.
@LeLeDeLaGeo
@LeLeDeLaGeo 3 ай бұрын
I asked myself the question while studying, and i came up with a definition that os really not what people expect, ok so basicalmy a shader is a file, wich you can code on, and that’s it, you can do whatever the hell yoi can do on a regular coding, getting other objects, do calculations, and have access to all coding features, what id the difference then ? A shader will be 100% processed by the gpu(so your graphic card) wich is a LOT faster to process basic calculations and repetitive operations(wich is the case for graphical effects such as black hole) So at the end, even if i want to render a grid, i can litterally make a shader(yes i already did that once) Conclusion : a shader is nothing but a code part that use the gpu instead of cpu
@DrBlort
@DrBlort Жыл бұрын
Very cool dissection of each element of the effect!
@edurizzoalbu
@edurizzoalbu Жыл бұрын
There's so much cool shader effects in outer wilds. I'd love to see more
@edurizzoalbu
@edurizzoalbu Жыл бұрын
Loved! Very cool details and so much fun to watch! Looking forward to see more
@dominkbarnett9837
@dominkbarnett9837 11 ай бұрын
Dam this video is good you deserve more views. Keep up the hard work and I bet your channel will blow up.
@dominkbarnett9837
@dominkbarnett9837 11 ай бұрын
Also maby work on a game more people are more familiar with. I love outerwilds but it's following isn't very big
@timvandeneng4724
@timvandeneng4724 Жыл бұрын
Dude I'm developing a space game and this video came as a GIFT! On god bro your a real one for this 🙏
@SaadTheGlad
@SaadTheGlad Жыл бұрын
I need to play outer wilds again
@dolfinsbizou
@dolfinsbizou Жыл бұрын
Now you got to do the white hole !
@lsdragon1718
@lsdragon1718 Жыл бұрын
Man, I'm not sure if it would solve every case with objects crossing the black hole etc. But I think you could have just use quad facing camera that would draw circle in the middle and aura that distort pixels behind it, instead of sphere with tons of polygons
@seanloughran6714
@seanloughran6714 Жыл бұрын
That was an extremely well done tutorial! It'd be super interesting to put a highly emissive source behind it to get the "picture" of a black hole we observed not too long ago.
@MrRaggedGaming
@MrRaggedGaming Жыл бұрын
I played through the outer wilds a bunch and loved it to bits. this is the first time I've actually seen the blackhole in the game just because of how pant pissingly terrified I am of black holes. I avoided looking at them at any cost, completely avoided the hollow planet, the one time I did end up there I couldn't force myself to look down at it, nevermind do the wrap around jump to get to the higher platforms. The teleporter black hole in the ship that leads to the ending, I could only walk into it facing away and even that was difficult every time I beat the game. I don't even know what it is about black holes that terrify me the most. The fact they look like unknowably massive eye that stares back directly into my soul, never blinking never looking away. The reality distorting horizon that blurs the line between the literal infinite and unknown and the comfortably knowable space around it. The absolute sudden shift to the pitch black center, devoid of any detail, no depth so you can't even tell how far away or how large it actually is. Probably all of the above. But what I do know is that the visuals alone are enough to trigger my fight or flight response, and it makes playing most space themed games a dice roll for me.
@QuontynTechArt
@QuontynTechArt Жыл бұрын
Honestly, I appreciate you still gave my video a click despite that. I promise I won't be putting black holes in any of my other videos haha
@Leobizaz12
@Leobizaz12 Жыл бұрын
Found out this video just in time as I finished playing Outer Wilds! Love the effect and the way you explain it! Will be paying attention to this channel for sure
@eeveelilith
@eeveelilith Жыл бұрын
Stardust Valkyries will be using this effect, to feature a character who quite literally can fight with black holes lol
@mr.l6332
@mr.l6332 Жыл бұрын
Great video! Love the pacing/humor (also super fortunate that I just thought about this today and you'd posted this video recently :))
@ariaaaaaaa2608
@ariaaaaaaa2608 7 ай бұрын
Love your videos! Looking forward to see more~
@minorseven8134
@minorseven8134 4 ай бұрын
Great video and great choice of music
@canm0m
@canm0m Жыл бұрын
Very solid recreation of the shader. I think you could maybe optimise out some of the trig functions by replacing the sphere with a billboard? You can get the depth of a fragment using the Screen Position node set to 'raw', and read the w coordinate. A triangle fan would let you bake the distance from the centre into UVs. Probably not necessary on a modern GPU though, especially when we have a bunch of reads from the colour buffer, which sadly makes it a no-go on a mobile tile-based renderer.
@ZedPoirier
@ZedPoirier Жыл бұрын
Such a good breakdown! Loved your video :)
@Aeris_16
@Aeris_16 10 ай бұрын
This is an amazing tutorial, you derserve more subscribers !
@joachimrefsland2210
@joachimrefsland2210 Жыл бұрын
Great video, just what i was looking for!
@Caye2013
@Caye2013 Жыл бұрын
Beautiful video!! Now this is the content i want to get recommended in KZbin
@knowercoder
@knowercoder 10 ай бұрын
Thanks for the tutorial. It's really helpful!
@Nahciak
@Nahciak Жыл бұрын
Your editing style is very nice. I really liked the vid even if Im not interessed in creating shaders in Unity. tbh this video should have way more views
@nivmiz0
@nivmiz0 Жыл бұрын
Great video! You went super in depth and the production quality is super high. I use a pretty similar technique in my own game to make my black hole, it's super cool to see you also making it in Unity (though yours is probably way better haha)
@sinom
@sinom Жыл бұрын
For rendering the black hole you probably didn't really need any sphere intersection. You could have just taken the normals from the sphere model. The center will always point directly towards you and you could have used some threshold to get something that looks like a sphere. Though I guess that would have potentially caused issues if there is an object inside the sphere but behind the black hole from your perspective.
@WackoMcGoose
@WackoMcGoose Жыл бұрын
One of the end-game craftables in Satisfactory has a very similar distortion effect on it. Nuclear Pasta, the final item you have to produce a crapton of for Project Assembly, has a gravitational light lensing effect around it (but no actual effect on game physics, it's as harmless to the Pioneer as any other non-radioactive item) that looks quite resembling to a black hole (since it's a tiny bit of super-compressed, but not singularityized, degenerate neutronic matter trapped inside a containment vessel).
@Loogable
@Loogable 5 ай бұрын
I want to use exactly this effect in my game and now I have a clear path on how to implement it, thanks! I will try to make the UV distortion move around and into the sphere more the closer it gets, might make the effect even more realistic. Can't be that hard... :"D
@SpringySpring04
@SpringySpring04 Жыл бұрын
I've always really loved the rendering of UV warping effects in games, animations, etc. So it's really cool to see black holes in games, and Outer Wilds is probably one of my favorite games ever! I really love the rendering of the black hole in the game, especially during the parts where you can see a black hole forming/growing, where it's radius and black circle parts are animated to grow and such. [Spoilers below] [WARNING SPOILERS!!!] For example, the warp pads/towers that can be found throughout the solar system, and also when you discover the secret of black hole time travel at the High Energy Lab on Ember Twin (which is quite the pain to get to), where you insert a black hole and white hole core, and you shoot your scout into the black hole and see it exit out of the white hole before it enters the black hole; when you insert the cores into the slot, it shows the animation of both of them growing, which is really cool!
@qualia765
@qualia765 Жыл бұрын
definitely enjoyed this
@UltimateYaowza
@UltimateYaowza Жыл бұрын
Mannnn, that is Amazing !!! And I love the way you explain everything ! ♥
@RandomProduct
@RandomProduct Жыл бұрын
This was a great watch! I don't pretend to know much about tech art, but I'm a gameplay programmer, so it's fun to see how other parts of the discipline work and think :) Also, Quontyn/Acerola crossover video when?
@ImHamsome
@ImHamsome Жыл бұрын
I am looking forwaed to more of your videos!!!!
@Vitamin_Games
@Vitamin_Games Жыл бұрын
Awesome video! Loved the detailed look at this
@midorayo1149
@midorayo1149 Жыл бұрын
i just discovered your channel im a new tech artist and i really loved this video
@noiadev
@noiadev 11 ай бұрын
Do I "need" a black hole shader? No. Do I want one anyway? Yes.
@fleity
@fleity Жыл бұрын
Lots of good explanations and well actually doing the math to solve the issues but I feel like you could have might your life a bit easier. For instance you could probably just use a transform node to get the screen space pivot position and then do a simple distance to the fragment screen position instead of the ray cast intersection.. I think?
@payne3156
@payne3156 Жыл бұрын
Dude I clicked on this video and watched the entire thing thinking it was made by someone devlog creator with >100K subscribers; only to scroll down and see you have 666 subscribers. You sir just earned a 667th
@arcturus2107
@arcturus2107 Жыл бұрын
Absolute banger
@meh536
@meh536 6 ай бұрын
very nice vid. instead of intersection testing for the black part of the hole, you could have used a fresnel and step node ^^
@NyanCoder
@NyanCoder Жыл бұрын
I was curious about it the whole video. How drawn the reflected side when the center of the black hole at the edge of screen. And wouldn't it be faster if drawing black circle based on fresnel capped with smoothstep/clamp (also can perform fwidth+smoothstep after that for antialiasing effect)?
@QuontynTechArt
@QuontynTechArt Жыл бұрын
Great point! I didn't put it in the video but you have to set the sampler state on your background texture to 'Mirror' so you don't get any discontinuities when your UVs go out of the [0-1] range. I omitted it just cause it's a bit technical to set when you're using a temporary texture like the GrabPass rendering feature I end up using near the end of the video. Obviously it's not "correct" but it actually looks not that bad since the actual black hole blocks some of it, and the distortion makes it hard to tell what you are even looking at. Honestly, you are probably right about using the fresnel to render the black hole LOL. My only thought is that it is probably harder to reconstruct the normal, but it should still be doable (and you don't really need it). Nice catch
@davioliveira35
@davioliveira35 Жыл бұрын
Great video!
@kigamezero8636
@kigamezero8636 Жыл бұрын
"Cool video, let me check what other content they have" *only 1 other video* "What' *only 321 subs* "WHAT" Seriously though. This is really well put together.
@FarhadHakimov
@FarhadHakimov Жыл бұрын
Less of a question, more of a shower thought. Would gravitational lensing look interesting or even make sense in 2D? What we're perceiving of a 3D (well...) black hole is projected onto our lens in 2D. Naturally, there'd be gravitational lensing... if we viewed it as a line. But if we're viewing it from the third dimension perpendicular to the plane, there'd be no light to bend on the other side? But if we were to rotate the black hole slightly into the third dimension... the 2D observer's line of view of the black hole would still remain, and we'd see the distorted light coming from the plane. Hmm. If you tell me I'm wrong, I won't be mad 🌝
@QuontynTechArt
@QuontynTechArt Жыл бұрын
I am definitely no theoretical physicist, so I'm not speaking with a lot authority haha. But yeah, I don't think of the math is exclusively to "3D Space", it's just that the light bending if you lived in a 2D world is not as interesting because you are perceiving things as a line like you said. But if you're perceiving a 2D world from a plane 3D I think it just falls apart just because the depth between the observer and the world is kind of unknown? But at least in terms of gamedev you can always just fake it and set the distance to whatever you want, ignore the third axis for calculations, etc. I don't know if there is even a "correct" answer to this but it could be fun to play around with and try different visualizations. I much prefer a believable but customizable system rather than a perfectly physically accurate system but no customization : )
@codelyoko363
@codelyoko363 4 ай бұрын
I'm loving this shader! Though, do you know if there would be anyway to exclude specific layers from the grabbed screen color? I'm having a issue of the black hole also warping the UI, which isn't what I want.
@QuontynTechArt
@QuontynTechArt 3 ай бұрын
Definitely possible, if the UI is an overlay I believe the whole UGUI pass happens after all this and wouldn't get affected by the distortion. I imagine your UI is in world space though? Which means it renders along with all the transparent objects, and because we added that whole rendering feature at the end, it gets included into the texture we use for distortion. I'm not sure if there's really an convenient work around, but I suspect you would have to write a whole new ScriptableRenderPass (like the UseColorTexturePass I import in the project currently) and set its timing to be after the UseColorTexturePass. Then you'd need to copy the UI shader and change it's light mode so it renders in that pass instead of the Transparents. So essentially what you'd be doing is creating a "World Space UI" render pass that renders all the UI after this effect which essentially excludes it from the effect : )
@LeLeDeLaGeo
@LeLeDeLaGeo 3 ай бұрын
really great shader, i struggled to understand some parts that where, on my point, a bit over engeenired, but overall really great, the only big diff with outer wilds, is that this one is not really satisfying to jump in, because ther is no distortion, it could be great to somehow make, like in the game, the distortion effect going trough all 360 degree angle of camera, either this, or maybe litterally doing a fullscreen shader pass instead ?
@maverson335
@maverson335 21 күн бұрын
Hey, great video, but I'm having some trouble following along. did you increase the fidelity of your sphere mesh by chance? I'm noticing that my light distortion is looking really choppy, and it's matching the lines created by the normals of the sphere. My guess is that it has to do with the nodes you posted at 8 minutes in, specifically the use of the normal vector. I tried taking the script from your github to compare, but it seems the nodes are the exact same.
@RedCabinGames
@RedCabinGames Жыл бұрын
Very nice tutorial! Any chance of explaining how you got the "_GrabbedTexture" from the custom URP Render Feature into the Shader Graph? I've got the package installed but I don't understand the Shader Code provided in the example enough to be able to convert it to a shader graph Custom Function. Maybe I don't need one, but I have no idea how to get the texture from the Render Feature! :( 11:10 how do I "use" that texture?
@QuontynTechArt
@QuontynTechArt Жыл бұрын
Yeah it is a little confusing and annoying so definitely not your fault haha. In your Universal Renderer Data asset you need to enable the renderer feature if you haven't done so, with the timing "After Transparents". You also setup the name of the texture and the light mode of the objects that need to use the texture, which you can name whatever, I think the default was "UseColorTexture" in the package. The problem though is that you can't change the lightmode within a ShaderGraph (as far as I know?) so the _GrabbedTexture won't be bound and will probably just look broken. So what I end up doing in my project is doing everything in the ShaderGraph, viewing the generated shader code from it, replacing the [ // LightMode: ] line with [ "LightMode" = "UseColorTexture" ] and then saving that as a new shader which is what I actually use on my material. The whole process is really annoying and I wish Unity exposed more controls to the ShaderGraph cause I run into these annoyances all the time lol. If you download my project you can see how it's setup. SG_BlackHole is the shadergraph I edit and S_BlackHole is the generated shader from it where I've changed the lightmode. I also have a comment in the shadergraph talking about it as well. Hopefully that helps! I know it sounds needlessly complicated (and part of the reason I don't touch on it in the video lol).
@RedCabinGames
@RedCabinGames Жыл бұрын
@@QuontynTechArt Thank you for the explanation! Yeah having to generate the shader definitely sucks, makes it much harder to iterate on the effect! I'll see if I can figure it out with this info! :)
@omnia4964
@omnia4964 25 күн бұрын
I'm trying to follow along but there's a lot of times you don't actually show how sections of nodes link up to one another
@sleipnir_8364
@sleipnir_8364 2 ай бұрын
Hello, how did you make the URP GrabPass shader work with ShaderGraph? It says it needs to have the correct LightMode tag. And I can only add that to a Generated shader from the ShaderGraph file.
@Pockeywn
@Pockeywn Жыл бұрын
it would be cooler with more turbulence it doesn’t look powerful enough
@bigwee125
@bigwee125 Жыл бұрын
I've tried making a shader similar to this that accomodates when objects fall near or into the black hole (because stuff falls into Brittle Hollow)... It didn't work because the object occluded the black hole's textures (which are at the backmost, after the object) itself. How would you tackle it?
@QuontynTechArt
@QuontynTechArt Жыл бұрын
You have to cut corners somewhere unfortunately haha, the shader in the video sort of supports this (there's some particle flying in at 0:12). But it gets tricky once opaque objects enter the black hole shell mesh, it kind of renders twice, once in the main scene buffer, and again in the distorted black hole pass. But depending on the situation you only want one of those effects. If it's still behind the actual black hole part it should be affected by gravitational lensing, but if it's in front black hole it shouldn't because these light rays don't actually pass by the black hole to reach your eye. In Outer Wilds', at least for Brittle Hollow, they use some cheats to mitigate this. Once objects get close enough to the center they shrink up and shoot into the black hole, which helps. They also have some sort of alpha clipping on objects that fall into the black hole so that any pixel in the actual distortion radius gets clipped. I'm not exactly sure what its doing, but check it out next time you play, there's some weird masking artifacts when objects actually hit the black hole, which is why I'm not sure if there is a "perfect solution". So to do it without cheating is hard haha. If it needs to be perfect I would probably end up trying to do some wacky render texture stuff. Render all the objects that might fall in, in two passes. First pass just renders the objects outside of the distortion radius normally, and alpha clips away any pixels in the black hole mesh shell radius. Second pass would render the objects into a different render texture (with depth) and alpha clip all the pixels that are outside of the black hole mesh. Then, pass that render texture into the black hole shader and let it figure out if those pixels need to distort or not based on it's depth. I don't even really know if this would work well LOL, but it at least separates the edge cases you'd have to think about.
@errorhostnotfound1165
@errorhostnotfound1165 Жыл бұрын
11:15 where demo scene?
@cihadturhan
@cihadturhan Жыл бұрын
I wonder if this is possible with built-in render pipeline
@QuontynTechArt
@QuontynTechArt Жыл бұрын
Should be! I think the only major difference here is that instead of using that render feature at the end you can just use the built-in GrabPass for the built in render pipeline. You have to be careful with the GrabPass for performance, but I think it can be useful for one-off hero assets like this
@cihadturhan
@cihadturhan Жыл бұрын
@@QuontynTechArt The last time I made a refractive material, I used reflection probes and used it as an input in shader graph. I think I can do the same for blackhole but I'm not that expert on this.
@Ayelis
@Ayelis Жыл бұрын
Or ARE you?! What happens when you "fall into it"? Do you get the same effect as in the game, where light wraps around you so much that it repeats and tiles? Is that even normal? Why does that happen?
@WingofTech
@WingofTech Жыл бұрын
Subscribing Immediately
@kalli4231
@kalli4231 Жыл бұрын
*Now in UE5 🤔e.e*
@kasen3688
@kasen3688 11 ай бұрын
'PromoSM'
@Krishna_Deva_Bruh
@Krishna_Deva_Bruh Ай бұрын
What a nice unfollowable tutorial
Minecraft's Terraria Mod is Incredibly Fun!
21:29
ChippyGaming
Рет қаралды 533 М.
Creating Simple Grass Shader in Unity URP
8:09
帕羅 Paro
Рет қаралды 25 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 4,8 МЛН
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 127 МЛН
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
Real-Time Black Hole in Unity | EP 1: New and Improved Shader
25:08
Simon Van Schuylenbergh
Рет қаралды 2,8 М.
Truly innovative FPS games
16:57
Riloe
Рет қаралды 333 М.
Moebius-style 3D Rendering | Useless Game Dev
8:12
Useless Game Dev
Рет қаралды 849 М.
I Created a Game Engine Just to Optimise This
4:50
Vercidium
Рет қаралды 1,1 МЛН
An introduction to Raymarching
34:03
kishimisu
Рет қаралды 152 М.
How to Procedurally Generate Meshes  - Using Godot Engine
25:20
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,5 МЛН
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 4,8 МЛН