Split Texture2D Across Line
- by Simie
Background
I'm using a texture as a damage map represented by an array of floats for displaying damage effects on a space ship in a process.
An upside of this is being able to 'slice' ships in half, using an input damage map with a line down the middle, as shown in the diagram below.
Question
However, I'm encountering problems separating this split ship into two different entities. I would like to be able to split the image down the 'damage line', in a process similar to this:
I don't have much idea where to start detecting the red line above. Any advice would be welcome.