I was messing around with the depth of field effect in CloneTroopers modded studio.
Using this there are probably hundreds of ways that this can be applied in games.
So this is what I created at first (based of a shader from minecraft) anyways…
Image 1
How did I create the first video?
So I started off with a local script in “StarterCharacterScripts” and then cast a Ray from the players head to about 5 studs out. Next, I checked if the ray was interacting with a part and if it did I activated the effect. I also put a for loop to make the transition more seem less.
I realised that glass actually removes the effect (Makes sense becuase thats how it works for people with glasses IRL)
Image 2
Final Result: All I did was put a glass cylinder in the scope
Image 3
I am going to try and implement this into boatbomber’s [Dual Render Scope] and see how that turns out.
Looks cool! I like the 3rd image/video where the gun isn’t blurred but everything is. Anyway it’s cool that DepthOfField exists on roblox for more realistic view.
Unfortunately I don’t think it’d be usable for scopes even if it does if your maps have any transparent parts in it (due to the still occurring glass bug)
That’s awesome! My dual render scope used the BlurEffect, so even the gun model got blurred. A DoF effect looks so much cooler! I wish that existed back when I was making it.
Because my scope is a ScreenGui, you don’t even need to rely on the Glass material bug! You can just set the DoF and my scope would stay clear.