您的位置:首页 > 其它

WWW获取Normal

2016-03-11 20:17 435 查看
loadedTexture
= www.texture;

normalTexture
=
new
Texture2D(loadedTexture.width,loadedTexture.height,TextureFormat.ARGB32,false);

Color
theColour =
new
Color();

for
(int x=0;
x<loadedTexture.width;
x++){

for
(int
y=0;
y<loadedTexture.height;
y++){
theColour.r
= loadedTexture.GetPixel(x,y).g;

theColour.g
= theColour.r;

theColour.b
= theColour.r;

theColour.a
= loadedTexture.GetPixel(x,y).r;

normalTexture.SetPixel(x,y,
theColour);
}

}

normalTexture.Apply();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: