For a prototype i am currently looking into ways to simulate an “infestation”.
Basically the map will slowly be overtaken by an infestation an the player has various means to fight or slow down the infestation.
- Infested terrain and all objects on top will be displayed differently to show the infestation.
- The player can place objects on the map that will slow down or stop ( maybe revert ) the infestation in a specific radius around the object.
- The infestations starts from several points on the map and will slowly spread until the whole map is taken over.
- rough sketch to show the idea ( red is infested area, blue is protected )
My idea right now:
- use a dynamic texture ( 4k ) that represents the whole map to store the infestation amount in “world space”.
- An “infestation controller” will read the texture, calculate the spread and store the result in the texture.
- The texture will be passed to the terrain and object shader.
- Texture information will be converted into object space and blend a second material over the original material.
( For small objects i might use a float parameter to blend the materials. )
I am a little bit concerned about the performance of the extra texture lockups and two materials on each object. Also the calculation of the spread will be quite complex and costly.
So i am wondering if anyone has alternative ideas how to solve this problem ( maybe using custom volumes, or a custom light channel, or using post process effects) ?
If you have any ideas or feedback please let me know, thanks