Support for importing DDS files would handle the ability to import mips, support for exporting images as DDS files from unity. including the generated mips, would handle the ability to edit the mips.
Full I/O support for DDS files would suffice nicely.
Oh, but Unity already supports that! (since Unity 2.1)
So DDS files are one way to get in custom mipmaps. Another way would be to manually editing them in a texture import post-process script. This can be quite cumbersome though.
DDS is just a file format that is documented and very simple. It originated from DirectX, but there’s nothing in the file format that makes it unusable elsewhere.
I see
I was under the impression (don’t ask me why), that not the full set of capabilities it offers are usable outside of DX (where at least from what I’ve experience so far, especially the NVIDIA provided loader is beeing used)
But thats potentially related to the fact that I’ve so far not seen any OGL engine that supports all those things in textures that DDS would have to offer.
I don’t know anything about Unity…
But if Unity eat the DDS, the mimapping subject is a Graphical-Card’s work, isn’t it?
Basicaly I edit my mimap level with this Nvidia pulgins :
Does unity have to access to the DDS information for getting mipmap level or the graphical card do all the work?
I know some rumor saying, if the graphical card get a Jpg, png, etc file, it will uncompress the picture like a BMP file…
… but if the graphical card get a DDS file, the graphical card doesn’t need to uncompress the picture data and will take the mimap level on the same way in the dds…
Does I have wrong? O_o? Does Unity have to do all this work?
(I’m not a programmer but this is an interesting subject to me )
Unity will read the mip levels from the DDS file. So yes, if you want to use NVIDIA’s plugin to do custom mipmaps levels, just save the DDS with mip levels and it will work.
… at least for you.
Mac users still don’t get the NVidia tools for Photoshop. And I also still don’t know of any (free) comparable Plugin toolset or standalone.
Good to know that about Unity and DDS files, though
Just a note that Gimp 2.6.8p now includes the DDS plugin, even on Mac OSX. However, I so far have not found a way to actually save my own custom mipmap levels into a single DDS file. It can generate levels for you which is not what I want, and it can do some kind of volume texture but I don’t think that’s the same thing. It seems pretty comprehensive otherwise. It can load mipmap levels into layers but maybe not the other way around? If anyone knows otherwise please let me know.
the iphone does not support DXT at all so having DDS is of the least use of all actually. The iphone native format would be pvr, for which imagination technologies offers a tool for at least windows to do such stuff (on osx you have apples command line converter) but I doubt Unity loads these pvrs actually
I think what I’m going to do is make a dummy texture and let Unity mipmap it, then get the mipmaps and write out my own pixels with SetPixels. Hopefully that should work.
Ok. So now what I want to do is basically generate my own mipmaps within Unity using scripting and drawing operations. I’ll be using Texture2D.ReadPixels to grab the initial full-size texture. Then I will render the texture at a scaled down size (using bilinear interpolation or whatever) and grabbing those as mipmap levels. I could grab each of these into individual textures. However, I want to be able to grab directly into the actual mipmaps of a texture, OR be able to very quickly assign a texture to be used as a mipmap at a given level. I do NOT want to use SetPixels() as that involves copying pixels which is not what I want.
Is there any way to do this or does Unity not have this functionality?
An additional question… if I let Unity recalculate the mipmap levels after the initial grab, does it generate those levels using the GPU to scale down and grab, or does it do it all with the CPU/re-uploading of textures like you would do with SetPixels (ie the slow way)?
Sorry to bring up an old thread. I tried doing this, but it didn’t work. I could write the mip map levels if “Generate mip maps” was enabled, but nothing happened. But when I wrote the mipmap level 0, the write went through, but it seems that the mipmaps are generated (again?) after that - so all the mipmap levels got the same modification as the mip map level 0.
Is there truly a way to have custom mipmap generation or is this feature broken/unavailable?
I would like to add, since this topic is brought back, that I’m also looking for a way to cap the mip map level to 5 max (another voxel engine guy here). I’ve looked into DDS files, but apparently they aren’t going to work for iOS and I’m also using a Mac. And I’m not sure how to handle this via shader. Any help would be appreciated.