- Home /
How to hide a texture partially without rendering to it?
Okay what I actuallz want to do?
I want to implement a Fog of War system.
What I've already did
Basically I've followed this tutorial. It uses a ortho camera, a static plane above the map and a small plane above each unit(NPC, ..) to render on a texture which is used by the static plane. Depth-only clear flag enabled it will kinda draw on the texture.
What I really want to do Use the above explained method as the exploration-system. That means, everything drawn to the render texture will be ~50% transparent. This are is (in sense of gameplay) explored but not visible. Hostile units etc won't be visible. But I want to have a visible( area around friendly units.
My plan is to hide the rendered texture on my static plane partially to create the visible area. I would like to use a similiar system again. Use a shader to render on a texture (with solid color clear flag) and just hide the visible area of this texture on the other texture. I hope it is clear what I am asking. Is this possible / how would I do that?
Simple picture that shall explain the Fog of War system.