So in pursuit of adding parallax to my sidescrolling platformer game, I switched from manually moving the sprites based on camera movement to using a perspective camera and adjusting object’s Z levels.
Because the object in the background are now physically apart from each other, I figured I would try to use Post Processing’s Depth of Field effect to blur sprites that are further away from the player. However, the post processing depth of field is extremely finnicky, and I have no idea how to adjust the focus distance, aperture, and focal length so the player is in focus but the background isn’t. Ive spent about 2 hours on playing with the parameters and googling, and no matter what happens every element on screen is given the same amount of blur with no regards to their distance from the camera.
The Unity documentation gives basic explanations for these parameters, but they don’t make any sense when transferred into the unity editor. Does anyone have experience using DoF in 2D and could help me make sense of focus distance/aperture/focal length, or have any other solutions to adding blur to background objects?
EDIT: Screwing around with the near clipping plane on my camera seems to have significant effects on the way the DOF Post Processing is being calculated, even though I’m not actually ‘cutting’ any objects by increasing it.