Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

I didn't implement this to improve performance, as I didn't think it was necessary. But you could use the Depth of Field effect, which allows you to define exactly the areas where you want to blur.

How exactly do you control which part of the screen is in focus?  I've adjusted all the settings extensively and I can only ever get the whole screen to be blurred, or none.

Create a mask surface cleared with black color, them draw a white shape inside, which is the focus area. Send this surface as texture to the effect, using .SetEffectParameter(). Don't forget to enable the "Use ZDepth" parameter in the code.