- Home /
WWW can not load .tga file , is there any issue in WWW?
Use Resources.Load() to load all kind of image success, include .jpg,.tga and so on. Use WWW to load .jpg no problem , but load .tga fail.
e.g:
string jpgPath = "file://D:\\Texture\\Scene1\\0001.jpg"; string tgaPath = "file://D:\\Texture\\Scene1\\0001.tga";
WWW wwwCache = new WWW(jpgPath); WWW wwwCache2 = new WWW(tgaPath);
void Update() { if ( wwwCache.isDone ) _texture = _wwwCache.texture;
if ( wwwCache2.isDone )
_texture2 = _wwwCache2.texture;
}
The _texture is the jpg image, and using good. But _texture2 can not use , no image and no format info.
Is there any issue in use WWW to load tga file ?
Answer by mviuk · Jun 07, 2012 at 09:24 AM
WWW only supports PNG and JPG, so the easiest option is to convert your TGAs to PNG. The alternative would be to integrate some sort of TGA loading yourself and parse the loaded bytes, but this is unlikely to be worth it.
Reference: http://unity3d.com/support/documentation/ScriptReference/WWW-texture.html
Your answer
Follow this Question
Related Questions
Free memory after WWW.LoadImageIntoTexture 1 Answer
load csv www 0 Answers
Load external mp3 File without streaming 1 Answer
Can't play two audio with same clip by WWW 0 Answers
the texture appear rubbish 1 Answer