I’m trying to find the correct skin shader for a character model created in Blender. It has a diffuse texture and two other related textures. These textures are called:-
skin_diff
The diffuse texture.
skin_bmp -
I thought the bmp indicated normal (bump) image. But those are normally blue. This image is grey but when zooming in you can see the face like in the diffuse and what looks like skin pores. Is this a detail?
skin_spec -
This image is various shades of black but very bright white around the lips eyes. I guess spec stands for specularity. If so, then I can’t see how I can add this image as specularity is controlled by sliders.
The imported material name is not too helpful. Its just called “Skin1_layer__skin_diff_jpg”.
Yep, diff is the diffuse, bmp will be a greyscale bump map which you can tell Unity to convert to a normal map in the inspector, spec will control the strength of the specular highlight.
If you put the spec into the alpha channel of the diffuse texture, it will control the specular brightness when using the Bumped Specular shader.
Specularity is actually controlled by the alpha channel of the diffuse texture, and glossiness (or the “Shininess” as Unity ridiculously calls it) is controlled by the slider.
Thanks! How do I add the the specularity image to the alpha channel of the diffuse? Can this be done from within Unity somehow or an external image aditor. I’m only guessing here, so let me know if I am right. Open the two jpegs into a image editor, add a layer to the diffuse image. Top layer being the diffuse. Select the new layer and make it alpha (somehow), and paste in the specularity jpeg into the alpha layer. Then save to a png (if thats the right file type).
Thanks. I’ve never used an alpha channel is this way before, so is it it a case of just making a new layer, make it an alpha layer (looks like a checkerboard) and paste in the specular image.
Also, is a png file ok for this work, since it has an alpha channel.
Unity doesn’t support packing textures on import, although you could write a script to do so. Otherwise, you have to do it in your image editing program and save it in a format that supports alpha (i.e. just not JPEG). Exactly how this is done depends on your image editor.
I think I confused layers with alpha channels earlier. I have PaintShop Pro (v10) Gimp 2, but I’m more used to the former. Its probably similar to other editors. Here are the steps I’ve taken. Let me know if I’m on the right track:
Load both images into editor.
marquee select the entire specular image.
3 Selections > Load/save selections > Save selection to alpha channel
Choose the diffuse image from the dropdown selector
Give alpha channel a name (optional).
save to a uncompressed tga file.
Check that Unity imports as DXT5 RGBA.
I hope thats it…
EDIT: I saved as 24-bit uncompressed tga, but unity imported it as a DXT1 RGB, which doesn’t have an alpha channel… Officially confused here
I am not familiar with either of those programs, but 24-bit images are RGB-only. Uncompressed RGBA uses 32 bits per pixel. TGA supports 32-bit images, as do most formats other than JPEG.
I increased the image to the maximum in Paint Shop Pro (16-bit per channel). Its own proprietary file format (*.pspimage) does have an alpha channel loaded. But when saving to png or tga, and reloading the save, it reverts back to 8 bits per channel with no alpha. I’ll try Gimp… that program has always been popular with the modders.
PSP 10 supports 16-bit channel? Maybe I should upgrade
However this has nothing to do with alpha. 24-bit (or 8-bit per channel) is the color depth you have to use. I guess the problem lies in your workflow.
This is how I do it(the menu commands may differ):
1.Open diffuse as well as alpha image
2.Switch to diffuse image
3.call Layer->mask layer->from image
4.choose your alpha image
5.call Layer->mask load/save->save to alpha channel
6.delete mask layer(its now stored in alpha channel)
7. save as 24-bit TGA