Texture2D.GetPixelBilinear 双线性获取像素颜色


function GetPixelBilinear (u : float, v : float) : Color

Description描述

Returns filtered pixel color at normalized   coordinates (u, v).

返回在正规化纹理坐标(u,v)处的过滤的像素颜色。

Coordinates u and v go from 0.0 to 1.0, just like UV coordinates in meshes. If   coordinates are out of bounds (larger than 1.0 or smaller than 0.0), they will   be clamped or repeated based on the texture's wrap mode.

坐标U和V 是从0.0到1.0的值,就像是网格模型上的UV坐标。如果坐标超出边界(大于1.0或小于0.0),它将基于纹理的包裹重复方式进行限制或重复。

Returned pixel color is bilinearly   filtered.

返回双线性过滤的像素颜色

The texture must have the   Is Readable flag set in the import settings, otherwise this function will   fail.

这个纹理需要在导入设置里设置为Is   Readable(可读),否则此函数将会无效。

参见: GetPixel .


,