Method ExtractRegionMask
ExtractRegionMask(Texture, Bounds, Bounds, int)
Extracts the part of a source mask represented by target world bounds into a new square render texture.
public static RenderTexture ExtractRegionMask(Texture sourceMask, Bounds sourceWorldBounds, Bounds targetWorldBounds, int targetResolution)
Parameters
sourceMaskTextureMask representing
sourceWorldBoundsin world XZ space.sourceWorldBoundsBoundsWorld-space bounds represented by the source mask.
targetWorldBoundsBoundsWorld-space bounds that the returned mask should represent.
targetResolutionintWidth and height of the returned mask.
Returns
- RenderTexture
A created, linear RFloat render texture owned by the caller. Pixels outside the source bounds are zero.