Is it possible to draw an image at realtime?
Ok some background info
The game creates a 2d mesh based on the player's field of view using raycasting.
This mesh has a transparent material applied to it.
The game is in 3d
Conceptually it looks like the below.
Grey= not seen white = seen orange = obstacles obstructing view green=player
I have access to the vectors of each vertex of that mesh.
I would like to draw an image that takes the mesh, colours it white and places it on a 2d image with everything else black. like so.
I would like the image to be drawn to fill the camera view while retaining the correct proportions to the mesh so it looks like an overlay. I'd also like to apply a custom shader of mine that blurs black and makes white transparent.
is this possible, if so how?
The effect that I want is to blur and desaturate what the player cant see. I have attempted to use a stencil shader but that is all or nothing from what i can see and the stencil mask removes shadows.
An answer to the above or a solution as to the effect that i need would be fantastic.
Many thanks.