Pulling Transparent PNG from the internet at runtime.

I know I can pull a JPG through the internet at run time, but is there a way to get a trasparent PNG file through too?

Currently no. Unless you get some .NET library that decodes PNGs (or write a plugin in the case of standalone game).

If you want to go the plugin route, I can recommend stb_image - it’s a single C file that reads PNGs and JPGs and has a dead-simple interface. It’s not the official implementation (these would be libpng and libjpeg) though.

Thanks Aras… I’ll stick to JPGs for now… :slight_smile:

Are there plans for PNG support? Or should I start looking through the .net libraries?

This thread is outdated. In Unity 2.0 www.texture supports PNG or JPEG.

Cheers,
-Jon

C’mon Brian, catch up man! This topic is soooo pre-2.0. :slight_smile:

WWW.LoadImageIntoTexture

Edit: damn, beat me to it! :stuck_out_tongue:

Oh man, I totally missed that. A nice addition. I assume they decompress to RGBA 32… There wouldn’t happen to be plans for a runtime DXT compressor too…

That would make my life too easy.

Consider your wish granted - yes, it decompresses to RGBA 32 bit! :roll:

I have no idea what you’re talking about. No, really. DXT? Is that edible? :slight_smile:

DXT1 or DXT5… The S3 hardware compression formats unity supports… I want to convert back to DXT1 from RGBA at runtime, without having to write the compression, if possible.