• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Game Modifications › Custom Texture Projects v
1 2 3 4 5 ... 8 Next »

Custom Texture Tool PS v31.2
View New Posts | View Today's Posts

Pages (51): « Previous 1 ... 47 48 49 50 51
Jump to page 
Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Custom Texture Tool PS v31.2
01-22-2018, 02:19 PM
#501
Bighead Offline
Oversized Cranium
*******
Posts: 1,503
Threads: 12
Joined: Aug 2011
New version, enormous speed increase, lots of changes, lots to cover.

v29.0 : Download - Mirror

Alpha vs. Transparency

Let me start out by saying I don't always make the best decisions. Before BC7 support, there were only two DDS formats this script created: DXT1 and DXT5. Because I wanted the script to automatically figure out which format to choose, a method was created to detect if PNG images had an alpha channel. At first, I just checked for the channel, but soon realized this can miss some textures because images can have an alpha channel but not actually contain transparent pixels. So then I used ImageMagick which can scan an image for transparency, but this method was slow. I eventually researched my own method to loop through every pixel and read the alpha value. This was much faster, but of course, it was still slow. This is the method that has remained for ages, and eventually creeped its way into other options of the script.

Much time has passed, my prospects change, new stuff has been implemented, and I no longer think its as important to know whether or not images have transparent pixels. The method for checking for alpha pixels is far too slow, so I have gone back to just testing for alpha channels. This has a few drawbacks: fully opaque PNG images with an alpha channel will be created as 32-bit RGBA instead of 24-bit RGB, and DXT5 images will be created instead of DXT1 if using those formats and the option to auto-select the format. Neither of these situations are important enough for the time it takes to actually test transparency in images using PowerShell. I thought about trying to use memory pointers which is supposedly much faster than copying to byte arrays, but apparently PowerShell does not support this, and for good reason (people could use it maliciously to alter RAM contents). C# is allowed to to this with "unsafe" code, and it's possible to use C# code blocks in PowerShell, but I'd rather not go down that alley especially since my knowledge of it is still limited.

So a bit more important, alpha check is also used to know which quality to pick for BC7 images using Compressonator, so very large opaque images may take longer to generate if they have an alpha channel. It is possible to avoid this by using the option to remove alpha channels from opaque images, which I will talk more about in a minute. The same situation holds true when applying upscaling filters. The seamless method by default is only chosen for images without an alpha channel unless it is forced to all images. This means the seamless method may not get applied to some images that should have it applied to keep the seamless effect. This can be worked around by forcing the seamless method for all textures, or fixing them to not have alpha when they shouldn't. Again, neither of these situations seems important enough to justify the slowdown caused by checking every pixel.

The whole checking for alpha pixels was basically me trying to fix problems created by others, but to be fair, it's an easy mistake to make, and in the real world has little repercussions outside of increased image size. Even I accidentally keep alpha channels in opaque images from time to time. The transparent pixel check is not completely gone from the script, it is still used in the option Remove Alpha Channel From Opaque Textures which has been around for awhile now and has been reworked a bit. So if you absolutely want all textures to be perfect and not contain unnecessary data, this option will do exactly what it says. This only needs to be done once, and it only works for PNG images. This will ensure all the potential issues I mentioned above won't ever be an issue. It's unfortunate that there really is no faster way to test images for transparency, at least not using PowerShell. My method is as fast as it can possibly get, but it's still far too slow.

Now that the transparency check has been replaced with just a check for alpha channels, I decided to do a basic issue scan on the Paper Mario: TTYD pack. This is always my go pack for the reason it has over 4000 textures of various types and sizes, covering a large spectrum of what I need to test.

00:27:15.28 - Before
00:03:06.48 - After

What took nearly a half hour can now be done in 3 minutes. Like I said, I do not always make the best decisions. This time was added to almost every single option including DDS conversions, as a texture is always scanned before anything is done with it. This is a huge speed up everywhere, and I regret not "fixing" this sooner.

DDS Fast Mipmaps vs. Custom Mipmaps

I've always had two ways of generating DDS mipmaps: fast and custom. The "fast" method tells whatever program is being used to automatically generate all mipmaps when creating the texture. This method was used if the pack did not include mipmaps for the texture, or if the user forced new ones. The "custom" method generates all mipmaps as individual images, using either the top level (base texture) or mipmap levels already included in the pack. It then splices the generated versions together into a single image file and sets up some header data, which allows creating arbitrary mipmap effects in DDS textures which almost no programs offer. The custom method used to be much slower, but it's now pretty well optimized so there is almost no difference anymore.

I recently discovered when using the fast method that Compressonator is not creating all mipmap levels (its stopping at like 8x8 and 4x4), and Nvidia Texture Tools does not allow defining the number of mipmaps to generate. While this is not a big concern, I see this as a bug. It combats my option to define the number of mipmaps to generate, and it nags at my OCD to create images in the way that I want them to be created. So the fast mipmaps method has been scrapped and the script will always use the custom mipmap method. This way I know that they are always being created correctly, and it also allows me to always apply a sharpening filter if the dimensions change. I couldn't do this with the fast method, so mipmaps always had slightly higher quality using the custom method.

Mipmap Base Image

When a mipmap is generated, it needs to be created from somewhere, so a "base image" must be used. Now that custom mipmaps is the only method, I thought this could use improvements. Basically here's what is happening. If an image does not have mipmaps in the pack, or new mipmaps are forced, the first mipmap is created from the top level, and every mipmap after that is created from the previously generated mipmap. This means each mipmap will be generated from a smaller image. The result is basically the same, except now each mipmap does not need to be calculated from the top level. This offers a nice speed up especially for large images, and mipmap image quality as far as I can tell, is the same.

Next situation is the pack has mipmaps included. If they exist, the script uses those, no changes there. But, if it contains an incomplete chain, it will first use the mipmaps it can find. After the final included mipmap is used, the next mipmap is then created from the previous mipmap, and it will continue to use the previously generated mipmap until the chain is finished. If the user forces missing mipmaps from the top level, it will use all the mipmaps it can find, then generate the next level from the top level, and again use the previously generated mipmap from there on out.

If none of this makes sense, the only thing to take away from this is mipmap generation is now faster when mipmaps are not provided. No difference in generation speed if they are provided, slight speed up if the included mipmap chain is incomplete.

Other Changes

So that was the big stuff, but there are a bunch of other little things that don't require as much depth to explain. So here's the list:

• Converting BC7 to PNG now uses Compressonator. TexConv was used before, but as discussed earlier in this thread, it has issues.
• Image viewer improvements. A bug was fixed if "Force New Mipmaps" was checked. It caused DDS mipmaps not to show up. Also the viewer will now show the image format, which is useful to distinguish between BC7 and ARGB32 without opening up a hex editor.
• Fix up some of the more uncommonly used options like "Remove Invalid Mipmaps", which now only works on Dolphin "tex1" textures.
• Remove Alpha Channel From Opaque Textures now only works on PNG images. It used to work for DDS images, but this was to convert DXT5 textures to DXT1 if they did not have transparent pixels. As far as I'm concerned, this is now useless because of BC7.
• A small speed up when error checking DDS textures (which is an uncommon and discouraged procedure). There exists a check to calculate the number of mipmaps the texture should have, count the number of internal mipmaps it actually has, and compare. I realized I can just pull the number from the header, rather than extract them all and count them, which saves both time and hard drive life.

A lot of stuff was changed everywhere, rewritten, or scrapped completely which was not worth mentioning since functionality should not have change. I'd be shocked if I didn't cause any bugs with all these changes. So as always, if anyone finds an issue, please let me know.
Custom Texture Tool - Xenoblade Chronicles HD - New Super Mario Bros. Wii HD - Paper Mario: TTYD HD (Contributor) - Skies of Arcadia HD - Donate
Website Find
Reply
01-23-2018, 02:37 AM
#502
General_Han_Solo Offline
Senior Member
****
Posts: 421
Threads: 1
Joined: Aug 2014
Not loading. Sad


Attached Files Thumbnail(s)
   
Find
Reply
01-23-2018, 02:44 AM
#503
Techie Android Offline
Linux Superuser
****
Posts: 479
Threads: 28
Joined: Dec 2015
(01-23-2018, 02:37 AM)General_Han_Solo Wrote: Not loading. Sad

Have you tried using a newer version of PS?
[UHD] Animal Crossing GC Texture Project
[UHD] Animal Crossing City Folk Texture Project
Tumblr Page
YouTube Channel
Patreon
Donate
//OS: Ubuntu Studio 16.04 LTS & Windows 10 //CPU: i5-6402P Quad-Core 3.4GHz //Graphics Card: GeForce GTX 1050 //RAM: 16GB //HDD: 2x 3TB 7200RPM 6Gb/s
Find
Reply
01-23-2018, 03:43 AM (This post was last modified: 01-23-2018, 08:05 PM by Bighead.)
#504
Bighead Offline
Oversized Cranium
*******
Posts: 1,503
Threads: 12
Joined: Aug 2011
Oh right, I forgot PS v2 does not support "in", I think we've been down this road before. Tongue I prefer to keep the backwards compatibility so I'll replace that check. I need to get my VMs back up and running so I can make sure this isn't the only thing. About 2 weeks ago the hard drive that my virtual disks were on started acting funky so I pulled it. I'll try to plug it back in and copy them over to another drive.

Edit: This should work. And I fixed the description of the remove alpha channel option. I forgot to remove the tidbit of it working with DDS textures which it no longer does.
http://www.mediafire.com/file/k5mt9ovu889ivqm/Custom+Texture+Tool+PS+v29.1.zip


Edit Again: Rather than make a new post, one more small update just because it adds a feature I wanted:
http://www.mediafire.com/file/1n191dx6h798g1r/Custom+Texture+Tool+PS+v29.2.zip

A new advanced option has been added named Add/Remove Aribtray Mipmap Suffix. This only works on Dolphin mipmap textures. When reworking my textures and mipmaps, I was getting annoyed adding and removing the "_arb" suffix from various textures and mipmaps, so this option will do it for you. I definitely do not suggest using this for entire packs. It's a niche option, adding "_arb" will probably be a rare situation. I suppose it could also be useful to remove "_arb" from textures if Dolphin dumped them this way and the artist does not want the retexture to draw mipmaps at a fixed distance.
Custom Texture Tool - Xenoblade Chronicles HD - New Super Mario Bros. Wii HD - Paper Mario: TTYD HD (Contributor) - Skies of Arcadia HD - Donate
Website Find
Reply
01-24-2018, 12:22 AM
#505
General_Han_Solo Offline
Senior Member
****
Posts: 421
Threads: 1
Joined: Aug 2014
Yes, it works! Big Grin
Find
Reply
01-26-2018, 03:37 AM
#506
Techie Android Offline
Linux Superuser
****
Posts: 479
Threads: 28
Joined: Dec 2015
Odd problem here. I recently fixed my PC and reinstalled Windows and was setting up the programs for your script (imagmagick, compressonator...) and I left off TexConv and it's not showing a DDS BC7 option in the drop-down menu. I know I've been able to fully convert all my textures before using just the compressonator.
[UHD] Animal Crossing GC Texture Project
[UHD] Animal Crossing City Folk Texture Project
Tumblr Page
YouTube Channel
Patreon
Donate
//OS: Ubuntu Studio 16.04 LTS & Windows 10 //CPU: i5-6402P Quad-Core 3.4GHz //Graphics Card: GeForce GTX 1050 //RAM: 16GB //HDD: 2x 3TB 7200RPM 6Gb/s
Find
Reply
01-26-2018, 05:28 AM (This post was last modified: 01-26-2018, 05:42 AM by Bighead.)
#507
Bighead Offline
Oversized Cranium
*******
Posts: 1,503
Threads: 12
Joined: Aug 2011
TexConv has been a hard requirement for awhile now because in the past Compressonator failed to create some textures and I couldn't figure out why. It's possible that I was doing something wrong which I inadvertently fixed at some point, but I'd have to thoroughly test it because it was a very rare situation. It's even more important now that it never fails because I removed fast mipmaps, and creating custom mipmaps is where it failed the most, especially the smaller levels like 8x8, 6x6, 4x4, 2x2, 1x1.

It was this version I made it mandatory.
https://forums.dolphin-emu.org/Thread-custom-texture-tool-ps-v29-3?pid=448416#pid448416

General_Han_Solo also noticed the issue here.
https://forums.dolphin-emu.org/Thread-custom-texture-tool-ps-v29-3?pid=449180#pid449180

If you want to force adding BC7 to the list and always allow converting, delete these four lines:

Spoiler: (Show Spoiler)
[Image: se2eRuo.png]
Edit: Oh, the lines might be slightly off from that screenshot because I'm always modifying stuff between versions. But it should be a good approximation of where to find them.

If you use notepad++, I created this language file for my script which gives the syntax highlighting you see and makes it easier to navigate.
http://www.mediafire.com/file/kptb5muff5vwzvg/ctt-ps+syntax+higlighting.xml
Custom Texture Tool - Xenoblade Chronicles HD - New Super Mario Bros. Wii HD - Paper Mario: TTYD HD (Contributor) - Skies of Arcadia HD - Donate
Website Find
Reply
01-26-2018, 07:54 AM
#508
Techie Android Offline
Linux Superuser
****
Posts: 479
Threads: 28
Joined: Dec 2015
(01-26-2018, 05:28 AM)Bighead Wrote: TexConv has been a hard requirement for awhile now because in the past Compressonator failed to create some textures and I couldn't figure out why. It's possible that I was doing something wrong which I inadvertently fixed at some point, but I'd have to thoroughly test it because it was a very rare situation. It's even more important now that it never fails because I removed fast mipmaps, and creating custom mipmaps is where it failed the most, especially the smaller levels like 8x8, 6x6, 4x4, 2x2, 1x1.

It was this version I made it mandatory.
https://forums.dolphin-emu.org/Thread-custom-texture-tool-ps-v29-3?pid=448416#pid448416

General_Han_Solo also noticed the issue here.
https://forums.dolphin-emu.org/Thread-custom-texture-tool-ps-v29-3?pid=449180#pid449180

If you want to force adding BC7 to the list and always allow converting, delete these four lines:

Spoiler: (Show Spoiler)
[Image: se2eRuo.png]
Edit: Oh, the lines might be slightly off from that screenshot because I'm always modifying stuff between versions. But it should be a good approximation of where to find them.

If you use notepad++, I created this language file for my script which gives the syntax highlighting you see and makes it easier to navigate.
http://www.mediafire.com/file/kptb5muff5vwzvg/ctt-ps+syntax+higlighting.xml

Okay thanks it seems to be working now.
[UHD] Animal Crossing GC Texture Project
[UHD] Animal Crossing City Folk Texture Project
Tumblr Page
YouTube Channel
Patreon
Donate
//OS: Ubuntu Studio 16.04 LTS & Windows 10 //CPU: i5-6402P Quad-Core 3.4GHz //Graphics Card: GeForce GTX 1050 //RAM: 16GB //HDD: 2x 3TB 7200RPM 6Gb/s
Find
Reply
03-21-2018, 01:46 PM
#509
Bighead Offline
Oversized Cranium
*******
Posts: 1,503
Threads: 12
Joined: Aug 2011
New version available: http://www.mediafire.com/file/tz5kn544s4wy548/Custom+Texture+Tool+PS+v30.0.zip

It's been awhile since I made any updates, as there really isn't any room for growth when it comes to Dolphin texture packs. With that said, this update does not really benefit anyone who wants to use it for Dolphin texture packs, as the tool already does pretty much anything that anyone would ever need when it comes to Dolphin textures. Over the past few months I've been working on a texture pack for the PC game Trails of Cold Steel II, so I started to tailor it more and more towards being an "anything" tool rather than a Dolphin texture pack specific tool. But, I also didn't want it to become any more ambiguous for use with Dolphin packs.

So rather than add a bunch of options that Dolphin texture pack creators would never need, I removed the option "Allow All Images" and replaced it with a dropdown menu called "CTT-PS Mode". There are two modes, "Expert Mode" and "Dolphin Mode". When in expert mode, all Dolphin specific options are hidden away, and it allows processing all images just like Allow All Images used to do. Additional compression types become available, as well as the ability to force DX10 headers. While in "Dolphin Mode", only "tex1" textures are processed, several DDS compression types and a few other options are hidden, and all the Dolphin specific options become visible. In this way, it also allows me to add more "modes" in the future if I so please without interfering with the Dolphin aspects of it.

Dolphin can make use of DX10 headers, but for some reason the uncompressed formats do not seem to work with it or else I would have included it in Dolphin mode. I'm not sure why that is, but the header isn't really important anyway (at least not for Dolphin). I also renamed ARGB32 to ARGB8 since this name seems to be more widely recognized and its one character shorter. It still creates the same type of texture, there's just a bunch of different names to identify it (ARGB8, ARGB32, BGRA8, BGRA32). RGBA8 is available in expert mode, but IIRC Ishiiruka can not distinguish between the two so the red and blue channels are reversed in-game. All D3D9 compression types also now use the DX10 names, BC1 - DXT1, BC2 - DXT3, and BC3 - DXT5. The DX9 versions will still be created unless the header is forced, the only difference is the naming scheme. To me it feels more consistent this way, and everyone probably only uses BC7 these days anyway.

Another feature I added is niche at best, but I figured I'd mention it just for the sake of mentioning it. There's a texture in CS2 that I only wanted a single mipmap for, so I usually had to generate that texture separately. This became annoying, and often times I forgot that it needed this special treatment. So I added a new flag "_mm#" that allows forcing the number of mipmaps for a specific texture. If there's a texture you want 4 mipmap levels for specifically, just name that texture "TextureName_mm4.png" and the script will take care of the rest. Generating PNG textures in this way is a one shot deal, the flag will be removed from both the original texture and the new texture. When generating DDS, it will respect whatever is set for "Flag Removal". If providing custom mipmaps, only the top level needs the flag (TextureName_mm4.png, TextureName_mip1.png, TextureName_mip2.png, etc..).

That's all that's worth covering. The rest of the changes can be seen here: http://bhemuhelp.co.nf/other/ctt/CTT-PS%20Changelog.txt
Custom Texture Tool - Xenoblade Chronicles HD - New Super Mario Bros. Wii HD - Paper Mario: TTYD HD (Contributor) - Skies of Arcadia HD - Donate
Website Find
Reply
03-21-2018, 05:57 PM (This post was last modified: 03-21-2018, 05:57 PM by Admentus.)
#510
Admentus Offline
Nothing but perfection for gaming
*****
Posts: 770
Threads: 8
Joined: May 2015
Great update. I have seen your work on the texture pack of Trails of Cold Steel II for PC. That texture made definitely made the PC version the ultimate edition. You made my day there, but you did so did back then with the texture pack for the first game too. Both great amazing actually. Still looking forwards to Cold Steel III and IV and the missing Crossbell games.
Texture Packs: Super Mario 64 - Super Smash Bros. - Mario Kart 64 - Zelda 64 (Contributor) <-> Useful Codes: Paper Mario: The Thousand-Year Door
Find
Reply
« Next Oldest | Next Newest »
Pages (51): « Previous 1 ... 47 48 49 50 51
Jump to page 


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 2 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode