Method Remap
Remap(RenderTexture, Texture, float, float)
Remaps the normalized values of an input texture into a caller-defined output range.
public static void Remap(RenderTexture targetRT, Texture inputTexture, float outMin, float outMax)
Parameters
targetRTRenderTextureThe destination render texture that receives the remapped result.
inputTextureTextureThe source texture whose values should be scanned and remapped.
outMinfloatThe minimum value of the destination range.
outMaxfloatThe maximum value of the destination range.
Remarks
For most textures, the method first runs a compute shader that scans the source texture for integer-encoded min
and max values, then converts those values back into normalized floats by dividing by int.MaxValue.
The fullscreen remap shader uses that scanned input range to stretch or compress the data into the requested
output range. When inputTexture is UnityEngine.Texture2D.blackTexture, the input range is
treated as zero-to-zero and the scan step is skipped.