private void Awake() | Calls Initialize. |
private bool ClipRect(ref Rect targetRect, Rect boundaryRect) | Clips a rectangle to the mask bounds. Returns false if they do not overlap. |
private Rect GetLocalTextureRect(Rect globalTextureRect, Texture2D texture, Vector2 offset) | Turns a clipped mask rectangle back into the texture's own pixel area. |
private Rect GetTextureRect(Texture2D texture, Vector2 position) | The area a texture covers on the mask when centred on a position. |
private void MaskAdd(Texture2D texture, Rect globalTextureRect, Rect localTextureRect) | Adds a texture's colours into the buffer, skipping fully transparent pixels. |
private void MaskMultiply(Texture2D texture, Rect globalTextureRect, Rect localTextureRect) | Multiplies the buffer by a texture's colours, skipping fully transparent pixels. |
private void MaskReplace(Texture2D texture, Rect globalTextureRect, Rect localTextureRect) | Overwrites the buffer with a texture's colours, skipping fully transparent pixels. |
private void MaskSubtract(Texture2D texture, Rect globalTextureRect, Rect localTextureRect) | Subtracts a texture's colours from the buffer, skipping fully transparent pixels. |
private void OnDestroy() | Releases the compute buffer and render texture. |