Hi,
is there a way in Unity 3.4 to store custom textures (which were produced by external tools and provide data for each miplevel) in a more performant way than reloading them on every game start from scratch? I mean it would be nice if I could once create a Texture2D as I am pleased to and then call something like Texture2D.SaveToFile() and later Texture2D.LoadFromFile() to let Unity load this texture in DXT5 compressed format without any unnecessary processing… It is important to notice that these textures are not prebaked but must be loaded at runtime or more precisely are even unknown at editor time…
regards
chris
You can load them as DDS through WWW (or other texture formats)
but storing, unless you want PNG, is up to you to implement.
Ok thanks… I will take a look at DDS which should also support custom miplevels?!
If you find a tool able to do it.
Normally no, and unity won’t let you specify custom mipmap level data, they are generated from the orig size (what DDS tools as those plugins from NVIDIA and ATI do as well)
Yeah thanks that’s what I need ;)…
To sum it up:
- Create your miplevels as you like…
- Use the DirectX SDk texture tool (or anything capable for this task)
- Open the largest miplevel
- change surface format to “DXT1” or “DXT5”
- let the tool generate miplevels for you
- now you can navigate through all levels using PageUp/Down
- For each level except the highest resolution (which we already have) click “File->Open Onto This Surface” and load the file you have created for it.
- Save the cute thing as DDS file
- Drag it into Unity
- with the miplevel slider in unity you will now see that each level has been loaded correctly (hopefully; for me it works at least)
For me, another approach was even better… Just using NVIDIA Photoshop Plugin and letting it generate normal-mipmapped DDS files from our high-resolution PNG bump maps. This can easily be automated using Photoshop macros. The same for usual textures…
Maybe an admin could also change the forum title, because I think the initial one is very misleading and some users might actually be looking for this capabilities as well.