- Home /
Question by
diablolubi · Aug 26, 2014 at 04:24 AM ·
textureetc
Texture2D.LoadRawTextureData can be load ETC1 format Texture with no opposite?
When I use Texture2D.LoadRawTextureData to Load ECT1 format Tetxture but the loaded texture is opposite. it can be slove?
This is the code
string path = Application.dataPath + "/a.pkm";
byte[] source = File.ReadAllBytes(path);
Debug.Log(source.Length);
int headerSize = 16;
for(int i = 0 ; i < headerSize ; i++)
{
Debug.Log(source[i]);
}
byte[] buffer = new byte[source.Length - headerSize];
System.Buffer.BlockCopy(source, headerSize, buffer, 0, source.Length - headerSize);
Texture2D tex = new Texture2D(512,512, TextureFormat.ETC_RGB4, false, true);
tex.LoadRawTextureData(buffer);
tex.Apply();
Comment
Your answer
Follow this Question
Related Questions
Failed To Generate ETC Texture [SOLVED] 1 Answer
Textures format is not supported by device 0 Answers
Assigning UV Map to model at runtime 0 Answers
Failed to generate ETC texture? 5 Answers