UE4 材质多张图片拼接成一张图片(此处用2×2拼接)
//TexCoord,TextureA,TextureB,TextureC,TextureDfloat3 ReturnTexture = TextureA;
if(TexCoord.x <= 0.5 && TexCoord.y <= 0.5)
{ReturnTexture = TextureA;
}
else if(TexCoord.x > 0.5 && TexCoord.y <= 0.5)
{ReturnTexture = TextureB;
}
else if(TexCoord.x <= 0.5 && TexCoord.y > 0.5)
{ReturnTexture = TextureC;
}
else
{ReturnTexture = TextureD;
}
return ReturnTexture;