Тёмный

Dynamic Depth of Field in Unity - Game Dev Sandbox 

Game Dev Guide
Подписаться 114 тыс.
Просмотров 74 тыс.
50% 1

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 120   
@rutchjohnson
@rutchjohnson 4 года назад
Getting some major Sebastian Lague vibes from this style of video. LOVE IT! Keep it up man. I love these exploring Unity videos :)
@qwertycomp9618
@qwertycomp9618 3 года назад
100% agree! Loved the video style, very enjoyable :)
@AlexSprites
@AlexSprites 4 года назад
What a great first episode of *Matt's adventures into things he has no clue how to do but really wanted to figure out and make a video about* ! This video reminded me about the small considerations that go into making an experience, and even the seemingly smallest of aspects can really add to it. Great video, looking forward to what's to come!
@verified_tinker1818
@verified_tinker1818 4 года назад
"This video reminded me about the small considerations that go into making an experience, and even the seemingly smallest of aspects can really add to it." My bugs remind me of that every day.
@ryaneden4604
@ryaneden4604 4 года назад
I hope that this channel gets the recognition it deserves. Thank you for the in-depth tutorials and I hope to see more from you in the future.
@JonathanKitzrow
@JonathanKitzrow 4 года назад
There's nothing quite as satisfying as watching a roughed-out experiment with new mechanics turn into a polished experience. Loved watching this evolve.
@ryanhenderson8908
@ryanhenderson8908 2 года назад
Wow. Just watching a couple of your videos got me more excited about the future of gaming than any game trailer I've ever seen in my life.
@dhruvvadadoriya
@dhruvvadadoriya 2 года назад
You always trigger the creative GameDev inside me and I start thinking coz I am out of ideas currently. Thx for the videos dude :)
@vivanecrosis
@vivanecrosis 2 года назад
That was superb. I found this as I was looking for "how to do depth of field in Unity". It was far easier than I expected. I'm at the stage of trying things out and testing stuff, before I work on the actual product.
@thepolygonpilgrimage
@thepolygonpilgrimage 4 года назад
Loved the video as usual. The moment you mentioned an escape room style game my heart skipped a beat. I've been working on something like that behind the scenes for months using the First Person Exploration Kit by While Fun Games on the Asset Store. Really nice work sir, keep it up!
@declanshort2012
@declanshort2012 4 года назад
So calming to watch these videos
@xeoler4124
@xeoler4124 4 года назад
well Brackeys, Sebastian League, Mix and Jam, Makin Stuff Look Good and now Game Dev Guide...... my go to guys for any problem in unity !!! Damn good, short and on point with a little entertainment (just perfect) keep posting and take your time mate. ♥
@sabrango
@sabrango 4 года назад
this interaction is the best! Additionally , I think VR like movement in non - VR game is super as well
@tobiask9084
@tobiask9084 4 года назад
Amazing! Truly good work with your videos. As a senior developer but Unity rookie this is truly a source of knowledge!
@IndieScapeGames
@IndieScapeGames 3 года назад
Got exactly what I needed, so funny, since I joined your Patreon and googling questions you have a video already about the topic.
@GamaScythe
@GamaScythe 4 года назад
Not going to lie, THIS added to a concept I'm Pre-Deving right now would add just that tinny little hint of realism that I'm looking for. It would defiantly be a 'finishing and polish' element, but I love this idea of yours. You, Sir, get a thumbs up and subscribe from this one.
@ipiqqyfpv
@ipiqqyfpv 3 года назад
OMG ive been banging my head for at least 5 to get my drone's Focus distance to change depending on how far it is THX so much!!
@thewowo
@thewowo 4 года назад
5:32 *Is that euler that I smell?* 7:45 * Dies from gimbal lock * Now, seriously, please use true Quaternions
@BlackMesaEmployee
@BlackMesaEmployee 4 года назад
But quaternions are hard :(
@thewowo
@thewowo 4 года назад
@@BlackMesaEmployee you could just think of them as a magic box, with Quaternion.AngleAxis and multiplying them to add rotations together
@mz00956
@mz00956 3 года назад
Or you just use Debug.DrawLine everytime you work with them to figure out where what is pointing and get even more confused😂
@rosako
@rosako Год назад
This is absolutely gorgeous!
@mszczesnik
@mszczesnik 4 года назад
"yep, that's a plate" - I spilled my coffee :).
@zisiangsee
@zisiangsee 4 года назад
Is your Dynamic DoF script available to purchase from the Asset Store?
@3nertia
@3nertia 4 года назад
An escape room done this way would be AMAZING! That is *genius*!
@quentinturner3753
@quentinturner3753 3 года назад
Literally at this point in my project for my startup!
@tozzo6481
@tozzo6481 4 года назад
The quality is awesome! Very informative video, thanks for sharing
@tehuster
@tehuster 4 года назад
Amazing content dude, please keep posting you have a real talent for teaching and entertaining at the same time.
@gloriousptr
@gloriousptr 4 года назад
You deserve more subscribers! Your videos are really helpful and we'll explained. Really loved your channel
@myhops
@myhops 4 года назад
5:55 What if you slightly increased the intensity of a reflection while looking at it? I think this effect could also be achieved with ray-casting and would resemble how our eyes adjust to looking directly at bright lights/reflections. Great video by the way.
@clipartinc
@clipartinc 4 года назад
Great video! Could you follow this up with a tutorial on adding the items you pickup to your inventory and then being able to placing those items down within a room?
@dippydogz
@dippydogz Год назад
Nice - you could adjust the lerp time based on sqrt(abs(ray cast-current distance)) to simulate how fast the human lens can adjust focus.
@newbquesttv
@newbquesttv 4 года назад
Great video Matt! Cool experiment and technique.
@H3ck
@H3ck 4 года назад
great stuff man, keep it up, subbed after 2 videos. love your work
@ConcreteJungleGames
@ConcreteJungleGames 4 года назад
Really cool, thanks for sharing Matt
@timothysnave
@timothysnave 3 года назад
That's beautiful, man.
@krissloo143
@krissloo143 2 года назад
Lovely I did a similar experiment exactly a year ago xD The only addition was that I also lerped between the origanl and the final object rotation which added more beauty to it But your code certainly looks neater :) Great job
@uspaget
@uspaget 3 года назад
manyy possibilities! thanks for this
@khoavo1175
@khoavo1175 3 года назад
Really informative! Thank you very much.
@sima19995
@sima19995 2 года назад
Cinemachine actually comes with a feature similar to this as a volume override where you can assign a gameobject to keep in focus.
@Laumania
@Laumania 4 года назад
Very nice video - I have had the exact same idea and the my idea was also exactly as your about calculation the focus point - except I haven't actual done it yet. But the result here looks awesome and I will definitely try it out in my game. Thanks for sharing. Oh, I hit the subscribe button by the way :D
@AngryApple
@AngryApple 4 года назад
A really great and simple way of doing this. In the Book of the Dead HDRP Demo Project Unity uses the Depthbuffer(I think) to control the DoF, so you can focus on non Collision Objects like the Grass, but I never understood how exactly the calculations work. Also I cant figure out how to change any settings in the new URP PP Stack, the values are changing in the editor but nothing happens in rendering. Would be nice If you can explore this stuff :)
@vjanomolee
@vjanomolee 3 года назад
Make sure that you have the RP asset loaded in the graphics settings.
@masterkonni0594
@masterkonni0594 4 года назад
This is very great! The game feels a bit more realistic. Thanks for sharing this ;D
@trayfenodonnell5386
@trayfenodonnell5386 4 года назад
It appears things have changed since this video. If people are having difficulty finding the Post Processing Profile. The process as of this post goes like this. 1) Make sure HDRP is in your project with no conflicts or errors. 2) Make sure you have the HDRP asset in your project. 3) Create an empty game object in your seen 4) Add the Volume component it this object. 5) Click the New button next to Profile field in the Volume component 6) Double click the new profile you created, it should appear in the Profile field in the volume component. 7) Click the Add Override button when the profile opens 8) Now click Post Processing or the feature you are looking for. This took me hours to figure out. I do not see any documentation or tutorial that covers these steps. Hope this helps.
@GameDevGuide
@GameDevGuide 4 года назад
Yeah for what it's worth I'm not using the HDRP here, I'm using Built-In, which is why you encountered a different workflow.
@BrianBakerCA
@BrianBakerCA 4 года назад
@@GameDevGuide For HDRP this is what I came up with: using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; VolumeParameter volumeParameter; public Volume volume; private void Start() { for (int i = 0; i < volume.profile.components.Count; i++) { if (volume.profile.components[i].name == "DepthOfField(Clone)") { volumeParameter = volume.profile.components[i].parameters[1]; volumeParameter.SetValue(new MinFloatParameter(15, 12, true)); } } } void FixedUpdate() { float distanceToFocus = Vector3.Distance(transform.position, focus.transform.position); volumeParameter.SetValue(new MinFloatParameter(distanceToFocus - 15f, distanceToFocus + 15f, true)); }
@TheSuperextragravity
@TheSuperextragravity 4 года назад
@@BrianBakerCA Thanks for sharing! Unfortunately, it doesn't work in unity 2019.3: Volume.cs(4,17): error CS0116: A namespace cannot directly contain members such as fields or methods
@LemonMontage420
@LemonMontage420 3 года назад
I have a question, why did you use Vector3.distance for "focus distance" rather than just getting the hit.distance?
@MrFarkasOfficial
@MrFarkasOfficial 4 года назад
really, top quality video. keep up the good work!
@otengmpofu6074
@otengmpofu6074 4 года назад
This project is screaming "VR!"... cool man, very cool...
@algotn
@algotn 4 года назад
i don't think dynamic DoF is something that ever should be mixed with vr.... It would be really really really disorienting.
@algotn
@algotn 4 года назад
maybe with eye tracking tho, could be used as a way to hide rendering a lower resolution on parts you're not looking at.
@timarlow8007
@timarlow8007 2 года назад
Cool, How'd you create the shader for outlining the object of interest?
@2014-b4o
@2014-b4o 4 года назад
u r a talented guy!!keep up the good work bro!!
@handsomelessking
@handsomelessking 4 года назад
Thank you sooo much, ive been trying to do this for 2 days
@jojoyoustudio
@jojoyoustudio 4 года назад
This is so a great idea ♥, it really helped me thanks.
@knowledgedh7700
@knowledgedh7700 4 года назад
I enjoy coding adventure videos, been watching Sebastian lauges videos. Now I found this so gonna subscribe and add these vids, thank you for the entertainment!
@oxylol6983
@oxylol6983 3 года назад
I am using URP to make a level design on unity (2021.1.17f1 version) with visual 2019 and the library "using UnityEngine.Rendering.PostProcessing;" and "PostProcessVolume" is no recognized, what can i do?
@oxylol6983
@oxylol6983 3 года назад
nevermind I found the solution... well whoever have the same problem may be change "UnityEngine.Rendering.PostProcessing;" for "using UnityEngine.Rendering.Universal;" and "using UnityEngine.Rendering;" then "Volume" is now as reserved word so you don't have to use "PosProcessVolume" and last but no least use "volume.GetComponent(); volume.profile.TryGet(out depthOfField);" and thats it :D
@laundryjx
@laundryjx Год назад
@@oxylol6983 Thanks! This really helped me out!
@oxylol6983
@oxylol6983 Год назад
@@laundryjx 🫡
@valentinstudio3334
@valentinstudio3334 Год назад
Excellent!
@sirgwindortvinuel
@sirgwindortvinuel 2 года назад
soo i switched to urp a few hours ago and post process profiles don't work for some reason. the script you made needed a postProcess profile but i can only use volume component. How do i fix this?
@dwapperom
@dwapperom 4 года назад
Hi Game Dev Guide, Is this code (without the bought package ofc) available somewhere for learning purposes? :)
@CTON2022
@CTON2022 4 года назад
Very futuristic
@navinagarwal8906
@navinagarwal8906 4 года назад
This video just blew my mind off..
@kingreinhold9905
@kingreinhold9905 4 года назад
Instead of lerping you could have set a speed at which the focus length changes... That would fix the fast transition on the background and might feel a little more natural
@marioluna3685
@marioluna3685 4 года назад
This is amazing but i this there's something i think we're missing... important focus points, i would make a checkerboard and look for important points. If you look at GTA V, focal point shifts as you do here but if you're looking at a tree and a person is closer than the tree but not in front, it'll automatically focus on the character instead of the tree. maybe assign some kind of tag to an object and focus important objects around the midpoint first and if there's nothing more important to show, or most points are closer things... you could make something really good about that, let's just say for a escape room game. Great video!
@ClydeDeSouza
@ClydeDeSouza 4 года назад
Brilliant. Loved the narrative wrapped style of delivery. I'd like to know what your thoughts were/are on Unity's physical camera and HDRP. Have you tried the same ArchViz scene in HDRP and Unity 2019.3.9. The post processing stack is now a "Volume" and I think the whole physical camera implementation is mucked up. My thoughts here: forum.unity.com/threads/the-unity-physical-camera-and-how-to-improve-it.877540/ I'd love to know if you'd be able to make the dynamic DoF script work for HDRP considering the Physical camera in HDRP would have physically accurate modeled Bokeh (claimed) and capture Volumetric atmospherics.
@spiritualshuv6915
@spiritualshuv6915 4 года назад
hey Game Dev, I've tried doing this but it's not working at all, is it possible you could make a video on the actual interaction with the game object and deselection of the object where it returns back to the original position. Would be grateful thanks.
@Yowax
@Yowax 4 года назад
Beautiful
@ChetanSaini420
@ChetanSaini420 3 года назад
How to do this on HDRP i'm able to DOF reference but what do i change there's so much Physical based Stuff With camera itself. PLS HELP!!!!
@OranCollins
@OranCollins 4 года назад
Game idea: use the Dynamic Depth of Field(DoF) to simulate how someone with bad vision sees, where stuff is intentionally blury, and use the DoF as a part of gameplay
@DashM670
@DashM670 2 года назад
Is the it possible to get this script on GitHub? Im new to coding and this would make the visuals much better and I can't seem to recreate the script your showing 😅
@IkikaeruRaimei
@IkikaeruRaimei 4 года назад
Everytime I watch one of your video, I always wonder... WHY LERP?! It's a linear interpolation from point a to point b based on t that is [0, 1]... What you're doing is a trick to achieve a move toward but really screwed up because of the interpolation problem from the zeno paradox. Well, it's not a huge problem but I found it so messed up.
@mitchwar2065
@mitchwar2065 3 года назад
Hi, I know that you released this at the beginning of the year and probably have no interest in answering any further questions but, I am trying to recreate this in the URP and everything was going great until I had to try and get a public Volume. For some reason, it doesn't exist through script even though it does in HDRP... It's mind-bogglingly annoying because there is no documentation on it either.
@creasu124
@creasu124 4 года назад
this is very interesting
@aeon_zero
@aeon_zero 3 года назад
Hello, does anyone know how I would go about making frosted glass in Unity? I know how transparency+blur works but the deal with frosted glass is that the effect is based on the distance between THE GLASS and THE OBJECTS behind it rather than just the CAMERA-OBJECTS. This mean that it would be some sort of DoF that considers CAMERA, GLASS and OBJECTS behind it. A double DoF? I don't know, my head hurts if I think too much about it :D Any help is welcome.
@dennisrkb
@dennisrkb 4 года назад
you should clamp the focus distance to the hyperfocal distance.
@vjanomolee
@vjanomolee 3 года назад
hyperfocal distance?
@dennisrkb
@dennisrkb 3 года назад
@@vjanomolee First of all, cool demo! Every lens (at every aperture) has a hyperfocal distance. If you focus on that distance you get the maximum depth of field. Although I don't remmeber why I recomended that 8 months ago..
@dennisrkb
@dennisrkb 3 года назад
Now I remember: There is no point in focusing beyond the hyerfocal distance, the image quality only goes down from there. But I doubt Unity simulates defocus blur at that level of fidelity..
@MarisSoftware
@MarisSoftware 4 года назад
Hello! Great video! Please do a tutorial about how to make a realistic car controller!
@brosoftproducts
@brosoftproducts 4 года назад
It would be great if you upload the script, so we don't need to copy it and get errors because of not seeing a line of code
@helloworld77771
@helloworld77771 2 года назад
Hi! Would you please share the script? Would like to try it! - thanks!
@morpheus7422
@morpheus7422 4 года назад
Great video
@johnsherfey3675
@johnsherfey3675 4 года назад
I feel like this could be used for a horror story game maybe.
@gabrielalvescunha9405
@gabrielalvescunha9405 3 года назад
Fucking amazing!! My God...
@LordParcyval
@LordParcyval 3 года назад
i need the script how can i get it ?
@zeeshanqaswar3573
@zeeshanqaswar3573 4 года назад
Very Nice!
@eec518
@eec518 Год назад
Would you like to share your solution? Meaning the PROJECT? So we can try it on our own? THANKS!!!
@MrFarkasOfficial
@MrFarkasOfficial 4 года назад
awesome!
@deepmitra3078
@deepmitra3078 4 года назад
Plz make a tutorial on making advance parkour and climbing system like assassin creed
@wassilchoujaa3478
@wassilchoujaa3478 3 года назад
Dynamic Depth of Field AND Fov. What do you think about that?
@gianfrancogarcia1491
@gianfrancogarcia1491 4 года назад
Brother, will you make a tutorial about this?
@GalactspaceStudios
@GalactspaceStudios 4 года назад
Hey man, nice video! Can you do this in Universal render pipeline?
@lousybook7608
@lousybook7608 Год назад
yuh
@razzraziel
@razzraziel 4 года назад
Enjoyable vid. Also i guess this is a kinda promo vid for ArchViz?
@GameDevGuide
@GameDevGuide 4 года назад
Nope! Needed a scene and paid for it out of pocket. I'll always disclose if a video is sponsored!
@razzraziel
@razzraziel 4 года назад
@@GameDevGuide Ah ok, a lot of folks doing that so thats why i guessed that. Keep up the good vids!
@BomboloaCat
@BomboloaCat 4 года назад
Nice vid
@michaelx6542
@michaelx6542 4 года назад
Love the idea. Love your way of presenting the stuff. Keep on going. If you could paste important parts of your code somewhere to play around - this would be awsome!
@notthere83
@notthere83 4 года назад
Ah yes, gorgeous houses probably none of us will ever actually live in. *sigh*
@dwindeyer
@dwindeyer 4 года назад
Has anyone come up with an efficient way to handle out of focus objects in the foreground without hard edges?
@batnikelam-mavzer443
@batnikelam-mavzer443 2 года назад
I Think Its Outdated, How Can I Use It in HDRP ?
@letsplaysquire3257
@letsplaysquire3257 4 года назад
Great video, looks fantastic! Any chance of you expanding on this to play with camera field of view and zoom to pull of the "Jaws" effect with a camera in game?
@TXanders
@TXanders 4 года назад
The "push-pull " effect, can likely use a very similar principle pulling the target at the beginning of the video. As in the real world, it's just the dolly moving backwards/forwards and the Camera Focal Length forwards/backwards respectively, simultaneously. This alongside the "Link FOV to Physical Camera" checked, so that when the focal length is changed in the camera it keeps the aperture in play and a physically-based DoF So long as the dolly action is predetermined in say, Timeline or Cinemachine, should be pretty straight forward to do if you code and understand a camera.
@TheBlackbirdii
@TheBlackbirdii 4 года назад
is it possible to share the code ?
@samirgutierrez3410
@samirgutierrez3410 3 года назад
you can provide the script please?
@AlexTuduran
@AlexTuduran 3 года назад
Don't use time as interpolator term in a damping formula like yours. Here's why. The expression a = lerp(a, b, t) is actually a First Order Low-Pass Exponential Moving Average Infinite Impulse Response filter where b is the input signal, a is the filtered output signal and t is approximating the cutoff frequency of the filter. It's "low-pass" because it actually removes the high frequency content of a. It's "infinite" because given an initial amount in a and a cutoff frequency lower than 1, a will never actually reach b mathematically. It's "exponential" because t is not actually the linear cutoff frequency, but rather approximates the cutoff frequency if used in a c^t form, thus changing it linearly yields a logarithmic cutoff frequency, so using deltaTime as a term of t makes very little sense. T should be set as a constant and regarded as a between 0.0 (complete cutoff - 'a' never changes) and 1.0 (instant transfer - no frequency cutoff or cutoff fq equals the nyquist frequency of the signal). If you wish to give t a linear meaning and try to compensate for variable framerate, at least write t as a function of deltaTime and a constant, but in a normalized exponentiated form like t = pow(c, deltaT) / (normTerm), where c is a constant, time-invariant "focus speed" and normTerm is the max value of c^dT, so that t stays in the unit range 0 to 1. Hope that makes a bit more sense.
@mehmedcavas3069
@mehmedcavas3069 4 года назад
good to follow you on insta :D
@Geoforcee100
@Geoforcee100 4 года назад
so confused right now :D
@yahyasezgin7732
@yahyasezgin7732 4 года назад
hı can you share project file with us , it will help us to better understand
@titoguidotti2397
@titoguidotti2397 4 года назад
Me wanna a download link
@Anthony_Horace
@Anthony_Horace 4 года назад
Please Script)))
Далее
skibidi toilet multiverse 042
20:57
Просмотров 4,7 млн
DIY Pump Solutions
00:18
Просмотров 1,1 млн
🎙ПОЮ ВЖИВУЮ!
3:07:23
Просмотров 914 тыс.
The Future of Game Development
8:58
Просмотров 1,3 млн
Unite 2023 Changed My Mind About Unity...
7:49
Просмотров 13 тыс.
I tried coding my own graphics engine
4:23
Просмотров 207 тыс.
10 Minutes vs. 10 Years of Animation
19:29
Просмотров 1,1 млн
How to ACTUALLY get into Gamedev
14:01
Просмотров 733 тыс.
How To Get A Better Grid Layout in Unity
12:04
Просмотров 211 тыс.
Simple Fog In Unity
7:01
Просмотров 57 тыс.
skibidi toilet multiverse 042
20:57
Просмотров 4,7 млн