Best way to convert or load custom texture format

Started by
10 comments, last by REspawn 11 years, 2 months ago

So from doing some reading and testing, looks like the best option is read the data from the file into a buffer, create my texture, lock the rect and then switch the channels as needed. I can't seem to find anything here or on Google that suggests a better way.

It produces the correct texture data and it's not too slow. Is there a better way?

Not really - this is really the minimum amount of work that you could possibly do, so I doubt there will be any faster way to convert them (at compile time or runtime). As I mentioned above, you could just swizzle the channels in your shaders (which is supposedly free in GPU hardware) so that technically would be faster, but then you will be modifying your shader code based on the external formats, which isn't a good thing.

I would say that especially if this project is just for education, then build a standalone tool that will do the conversion for you. This will give you some additional experience, plus some reusable code to boot. And since nobody knows of a good program to do this already, you could throw the results up on GitHub or CodePlex and let everyone know how to do it :)

Advertisement

Stand alone conversion tool seems like the best and most fun way to do this. I'll update this thread when I put the code up somewhere.

Thanks for all the help.

This topic is closed to new replies.

Advertisement