PDA

View Full Version : Multi-channel image editing (RLES, shadows etc) with Paint.net and friends


plasticbox
16th Jul 2015, 1:20 AM
Some of the image formats for CC creation require editing channels individually (like the alpha); sadly Paint.net does not have the ability to view individual channels out of the box.* But it is not very difficult to work around that limitation: you can use a separate tool to split out the alpha channel so you can edit it separately, and then merge it back into your DDS when you're done.

I'm going to use dxtbmp (http://www.mwgfx.co.uk/programs/dxtbmp.htm) for this purpose; there are probably other, similar utilities as well.

For this example I'm going to copy and edit the specular of a Maxis full body CAS part and make it fit a custom top that I made from that full body -- but you can use the same basic principle to edit self shadows, speculars for objects, basically anything where you need direct control over the alpha channel.


1. Clone the CAS part you want to use the specular of: in CASTools, go to "Cloning Tool", select the item you want (it doesn't matter which colour variant) and hit "Clone!"

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_thumb_plasticbox-1550946-channels_01_clone.JPG (http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1550946-channels_01_clone.JPG)


2. Open the package you just cloned, in the General tab click on the little “Specular” thumbnail and in the window that opens, hit “Export”

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_thumb_plasticbox-1550954-channels_02_export.jpg (http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1550954-channels_02_export.jpg)


3. Open the exported DDS in dxtbmp (this shows the DDS without alpha in the main view, hence why it’s all green) and doubleclick on the alpha preview (top right), or use the icons below it to open the alpha in paint.net ‒ you may need to explain dxtbmp first what editor you want to use (top menu > Prefs > Select editor, or click on the editor icon on the right-hand side, where my screenshot shows the Paint.net icon)

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_thumb_plasticbox-1550955-channels_03_dxtbmp-alpha.JPG (http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1550955-channels_03_dxtbmp-alpha.JPG)



--

RLES-specific excourse: note that RLES speculars for CAS actually have five channels:



Red = cube map blur
Green = cube map strength
Blue = specular falloff
Alpha = specular strength (overall modulation)
Mask = where to apply the whole thing


At present (version 1.0.0.6 and 7), CASTools drops the mask channel upon export to DDS (since a DDS only has four channels) and generates it from the alpha when it converts the DDS back to RLES upon import. See here (http://modthesims.info/showthread.php?t=552540) and here (http://forums.thesims.com/en_US/discussion/comment/12843869/#Comment_12843869) for more info.

--


4. Now you can edit the alpha like you want (in my case, I'm going to lighten it very slightly in the area where I want the specular to actually be applied ‒ so that the mask generated from it will fit my top and not the original full body ‒, and edit the RGB a bit), and save as new file (DXT5) ..

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_thumb_plasticbox-1550969-channels_04_pdn-edit.JPG (http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1550969-channels_04_pdn-edit.JPG)


5. .. then open the new RGB in dxtbmp and import the new alpha. I recommend opening and importing, rather than using the “Refresh” buttons ‒ for me it sometimes acts rather confused when I do the latter, showing a preview of the edited version but not actually saving it. :rolleyes:

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_thumb_plasticbox-1550970-channels_05_dxtbmp-alpha-new.JPG (http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1550970-channels_05_dxtbmp-alpha-new.JPG)


Save the result as a new file (DXT5 with mipmaps), and import it into your package. (The same way you exported it; you can also use s4pe 0.3a (https://github.com/Kuree/Sims4Tools/releases/tag/0.3a) ‒ I don’t know about 0.3b, but don’t use 0.3c since that’ll break the mipmaps.)




--

* There seems to be one plugin that apparently kind of does that, but it's hosted on a site that seems really rather questionable .. so I'm not going to link to that here.