Tuesday, September 30, 2014

How to Create DDS Pictures with Perfect Alpha


Click here to download all necessary DDS plugins for Photoshop from NVIDIA
The exe will automatically place the plugins into Photoshop so you do not have to worry about where to put them.

DDS files are video game textures, but how to get one with a perfect alpha is the real trick.
Let us use this picture of Twilight Sparkle.  You can use a different picture if you like.  Download and save it.  Since this picture has an alpha already, copy pasting the image will not work as the alpha will show up black.

Open the picture in Photoshop (I am using CC)

Use the eyedropper to sample the ink-lines on her body.

Create a solid color adjustment layer behind Twilight.


It is best to not use the paint bucket tool to fill the same layer as Twilight or a separate layer.  I find it works best if you keep the layer with Twilight transparent and a solid color adjustment layer separate. If you use the solid color adjustment layer, you will not have to use the paint bucket over and over again if you need to expand the canvas.

Select crop then change it to an image size that is the power of two.  Most video game programs like textures that are the power of two.  So common texture sizes are 256X256px and 512X512px.  So lets do 256X256px.


Fit Twilight in the crop box and commit the change.  If you have Photoshop CC, selecting the W x H Resolution will constrain the crop box to that shape.  CS6 or later, you may need to hold Ctrl+Shift+Left Click to constrain it to that shape. (I forget if that is right, comment if I am wrong.)


With the Twilight layer selected, control click the layer icon.  A marquee (marching ants) will trace around Twilight.


Go to channels, click on save selection as a channel.



Check out how you did by trying to save it as a dds file.  Choose where to save it now, you can overwrite it later if you are not happy with the results.


Click on the "Preview Options" button.


Click on "Background Color".

Select a bright, vivid color like red.  You can make the background black but not white.  White will just make it hard to see the edges of the texture you are trying to save.  Click OK.

Click on the pull down menu button then select "DXT3         ARGB 8bpp | explicit alpha"*


Then click on 3D Preview.


In four rows of two, example pictures show what the picture will look like in different graphics settings.  You will often get two pictures without alpha.  Do not worry about it.


Holding down left click while moving the mouse will twist and rotate the pictures around, holding the middle mouse button down (not rolling down) will zoom in by sliding the mouse forward or zooming out by sliding the mouse back.  Holding down right click will move the pictures around.  Try zooming into the bottom right picture.

 
 ↑Left click and moving mouse↑
 ↑Middle click and moving mouse↑
 ↑Right click and moving mouse↑

If you are happy with the results, close the preview window then save it.

Now you are done if we only want the result in the bottom left.  I have not figured out how to get the textures with no alpha to be transparent.  If you happen to know how to get those to have an alpha, leave a comment below.

You can go to the next level by making it perfect.  If you look at the picture second from the top left, next to the picture with no alpha, you can see bright purple edges on Twilight's mane and tail.  To fix that, follow the steps below. ↓

Control click the Twilight layer icon.

Go to the select menu > modify > expand, then type in 1.


With the brush tool, alt click the ink lines on Twilight's mane.


Create a new layer between the solid color adjustment layer and Twilight.  Brush the outer transparent edges along Twilight's mane and tail.


Do a 3D Preview again then zoom into the second from the top left corner image.  Now the edges of Twilight's mane and tail have now have dark purple edges.  If anyone knows a faster way to do this, let me know in the comments.
 
↑Before↑
↑After↑

No comments:

Post a Comment