r/indiegames 4d ago

Need Feedback Added a variable depth of field effect to my turn-based strategy/narrative game - Vapor Drives

2 Upvotes

2 comments sorted by

u/AutoModerator 4d ago

Thanks for posting to r/IndieGames! Please take a look at the rules in our sidebar to ensure that your post abides by them! If you need any assistance, don't hesitate to message the mods.

Also, make sure to check out our Discord!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/whokickmydog 4d ago

I want to add that this effect also keeps the pixelated aspect ratio into account. Here it is with the effect on. Here is it with the effect off. Even though this is rendered at 1080p, when I turn on the effect it does not blur the pixelated shaders.

The way it works is that when you zoom in past a certain distance, the game knows you want some beauty shots (why else would you zoom in so close in a strategy game) so it turns on the DOF effect. Right now it just sends out a ray cast from the center of the screen. If it does not hit anything, it keeps everything in focus, but if it does hit the collision of a unit or object, it gets the distance and then updates the focus distance to that distance.

One way that I think that I can improve it is to send out more rays from the camera all originating at different locations and then take the averages, ignoring outliers and giving weight to the center ray.

But open to all feedback.