Hello! I’ve recently created a module that allows for a “realistic” depth of field effect in games. It raycasts from the center of your screen to where you are looking, and sets a DepthOfFieldEffect’s FocusDistance to the magnitude between the two points.
This emulates how your eyes focus on things in real life, hence why I’ve called it Realistic Depth Of Field.
If you’re having trouble figuring out what I mean, here is an example video (note the setting “SmoothTransitions” is enabled in this video, which is by default disabled):
Example use:
-- in a local script!
local m = require(path.to.module)
local settings = m:GetDefaultSettings()
settings.SmoothTransitions = true
settings.InFocusRadius = 30
m:ApplySettings(settings)
m:Start()
Need documentation or information about the module’s settings? It can be found here:
No credit is necessary if you plan to use this module, but please reply with cool creations you’ve made!
Are you referring to this post? My module is definitely similar, but it has more customization features and doesn’t raycast from your mouse’s position.
You can think of my module as an alternative to that one!
Pretty cool! I will use this for my game. Although your video preview is either a really short gif, or corrupted. So I cannot see how is it looking like, on mobile.
Super sorry for my late reply. The video preview has been fixed. The file hosting service I used is a bit peculiar so I’m not sure how long it’ll be up for, but if it breaks again I’ll fix it.
It’s an interesting module, but I feel like it would need eye tracking (if that was possible on Roblox) for it to really feel nice. In third person, The raycast basically always hits your character so that is not ideal. In first person, it does behave ok. I changed it to raycast to where the mouse was and um, it was very distracting