Page 2 of 2
Re: Write .dds-file with custom mipmaps - possible?
Posted: 2016-08-05T20:37:51-07:00
by HansCz
dlemstra wrote:snibgo wrote:Wouldn't it be more logical to take all the images in the current list, with a simpler define? Like this:
Code: Select all
convert image1.png image2.png image3.png -define dds:fromlist image1.dds
I also though about using this but I had the idea that this would be bad if you wanted to write multiple files in the same command. But now thinking about it that shouldn't be an issue. I'll talk with magick and see if he also thinks this is a good idea and then add it.
For what it's worth, snibgo's suggestion seems the simplest.
Also, how to handle the current -define dds:mipmaps=n, where n = the number of autogenerated mipmaps?
My initial thought is that autogeneration and manual specification of mipmaps should be mutually exclusive with dds:fromlist taking precedence over dds:mipmaps=n
What do you think?
Re: Write .dds-file with custom mipmaps - possible?
Posted: 2016-08-05T20:46:30-07:00
by HansCz
Maybe a better name than dds:fromlist would be dds:mipmaps_from_list
since dds:mipmaps_from_list is more coherent with the current dds:mipmaps
but then again, this might confuse the user as to whether dds:mipmaps has anything to do with dds:mipmaps_from_list
Hmmm... ambiguity is not good.
Re: Write .dds-file with custom mipmaps - possible?
Posted: 2016-08-05T21:07:50-07:00
by snibgo
I'm not fussed about the name of the define. My point was merely that IM already has a mechanism for creating image lists, rearranging them, processing them and so on. So a new method of specifying a list (probably with no methods for any manipulation) is a superfluous addition to product complexity.
Re: Write .dds-file with custom mipmaps - possible?
Posted: 2016-08-06T08:03:04-07:00
by HansCz
You're right. It would be a shame not to reuse the list capability here.
Re: Write .dds-file with custom mipmaps - possible?
Posted: 2017-02-16T06:10:38-07:00
by stefan_kubicek
Hi guys,
first post here!
I've been working in games for half my life but was only recently becoming aware of the possibilities per mip map control has to offer.
So far I was always using additional shading code to control certain distance-based effects, until the point where I had to optimize performance
more than usual, which lead me to searching the web for solutions, hence to this thread.
The closest working solution is currently NVidias DDS Photoshop plugin, which allows for per mip map control of an overlay color,
e.g. to have a texture fade towards a solid color over the row of the MipMaps, which is probably the most common application,
however it's really limited to just that, and often you need more artistic control.
Ultimately, I just wanted to know if there is any news on this topic as far as it's implementation into Image Magick is concerned,
it sounds like it could be the first truly versatile solution to this problem.
Cheers,
Stefan
Re: Write .dds-file with custom mipmaps - possible?
Posted: 2017-02-16T13:44:50-07:00
by dlemstra
Do you want custom mipmaps or the default ones that are created in the dds writer?
Re: Write .dds-file with custom mipmaps - possible?
Posted: 2017-02-16T14:06:58-07:00
by fmw42
Good point Dirk. I had forgotten about DDS. See
http://www.imagemagick.org/script/formats.php where it says
DDS RW Microsoft Direct Draw Surface Use -define to specify the compression (e.g. -define dds:compression={dxt1, dxt5, none}). Other defines include dds:cluster-fit={true,false}, dds:weight-by-alpha={true,false}, and use dds:mipmaps to set the number of mipmaps.
Re: Write .dds-file with custom mipmaps - possible?
Posted: 2017-02-16T15:28:51-07:00
by stefan_kubicek
dlemstra wrote: ↑2017-02-16T13:44:50-07:00
Do you want custom mipmaps or the default ones that are created in the dds writer?
There are many tools that create DDS files with default mipmaps. The novelty would be to allow for the definition of arbitrary images per mipmap.
Not sure how to handle different image resolutions for specified mipmpaps, i.e. whether the writer should enforce (read: automatically scale to fit) that each successive mipmap is only a quarter of the size of the previous one, or to just blindly take the supplied mipmap and write it out to the dds file in hope it has the correct resolution. Either way: Not the default ones.
Re: Write .dds-file with custom mipmaps - possible?
Posted: 2017-08-12T04:29:24-07:00
by dlemstra
The next version of ImageMagick 7 will finally include this feature. With -define dds:mipmaps=fromlist you can use the other images in the list:
Code: Select all
convert image1.png image2.png image3.png -define dds:mipmaps=fromlist image1.dds
The encoder also checks if the image2.png and image3.png have the correct dimensions and it will throw an exception if the dimensions are incorrect.