Dean Ashton Posted July 13, 2006 Share Posted July 13, 2006 I'm in the process of adding mipmap generation to my DDS plugin. To this end, I've added a checkbox to my UI to allow for the generation of mips to be optional. I need to be able to disable this checkbox, but I'm unsure as to how to get the currently-being-saved image's width & height. Reason being that you can only have mipmaps for power-of-two images in the DDS file format... so the option should be disabled for non-power-of-two images. I thought about putting the width/height in my token, but that seemed pretty crappy.. I don't want it serialised. I looked in the existing filetype plugins, but none use the width/height of the image within the save config widget code. Hints appreciated.. Cheers, Dean Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 13, 2006 Share Posted July 13, 2006 This information is not available to the SaveConfigWidget. You should instead name your checkbox something like, "Generate mip-maps if possible for 2^n sized images" Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Dean Ashton Posted July 13, 2006 Author Share Posted July 13, 2006 Hmm.. that's a real shame. It makes the output somewhat unpredictable.. all you need is a slight size problem, and it would silently stop exporting it. It can make a significant difference to filesize, and to runtime performance when using the texture. At least if I could do this, it would be clear to the user as to what was going on.. I might have to hack a workaround (if I can think of a way of doing it!), as I'm not convinced that any ambiguity like this at the point the image is saved is a good thing.. Dean Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 13, 2006 Share Posted July 13, 2006 Please don't hack in a workaround, as it is very likely to break in future version of Paint.NET. Or it would go outside the boundaries of what the plugin framework is providing, and will not be usable in all scenarios (now or in the future). I can accomodate this in a future release of Paint.NET but for now please do not hack around this. Otherwise I will be forced to break your plugin in a future release of Paint.NET just so that I can maintain a hack-free plugin framework. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Dean Ashton Posted July 13, 2006 Author Share Posted July 13, 2006 Ok, sure. Dean Quote Link to comment Share on other sites More sharing options...
Dean Ashton Posted July 14, 2006 Author Share Posted July 14, 2006 Had some time to check up in some DDS reference materials this lunchtime, as well as speak to some colleagues. Turns out it's quite valid to have non power-of-two DXT textures with mipmaps (it wasn't valid when I was working on Xbox titles way back.. hence the confusion). So as it happens this was all irrelevant anyway.. You could delete the thread, if you so wished.. Cheers, Dean Quote Link to comment Share on other sites More sharing options...
Illnab1024 Posted July 14, 2006 Share Posted July 14, 2006 Somebody else might need it for info...best to keep it here than somebody ask the same question. Quote ~~ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.