Home Technical Talk

GIMP - Image into Alpha Channel

polycounter lvl 17
Offline / Send Message
Lord McMutton polycounter lvl 17
I'm making some clothing for Oblivion, and am trying to get the specular to work right. From what I can gather, I need to get my spec map into the normal map's alpha channel. I'm using GIMP for this and can't seem to figure out how exactly to do this. Every bit of info for this that I've found is supremely unhelpful.

Replies

  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
  • Lord McMutton
    Options
    Offline / Send Message
    Lord McMutton polycounter lvl 17
    Yeah, that adds a pure white alpha channel. I still need to figure out how to get one image into another's alpha channel because, from what I can see, there's no way to edit the main alpha once it's created.
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    cop and paste the image into the alpha channel? I think there's a channel tab by the layers.
  • Eric Chadwick
  • JFinn_UK
    Options
    Offline / Send Message
    JFinn_UK polycounter lvl 7
    Thanks a tonne for that link. I know there's optmisation n all but dam, I kinda wish the Cryengine 3 had an option for a gloss map to just be loaded right in instead of this weird setup where it has to be in the specular images alpha channel.


    EDIT: Okay I've found 2 ways of getting my gloss map into the specular maps alpha channel, but not without it actually affecting the images alpha and mucking up the transparency of it all. How do I actually put an image into an alpha channel without it uh, actually affecting the images alpha?
  • Eric Chadwick
    Options
    Offline / Send Message
    I don't use Gimp, but the alpha is stored as a separate channel from the three color channels, so it's probably just a Gimp preview mode that makes it look like they're dependent.

    If you use a format like PNG, the alpha can change the RGB channels. But a format like TIFF keeps it completely separate.
  • JFinn_UK
    Options
    Offline / Send Message
    JFinn_UK polycounter lvl 7
    Ahh, that explains how Cryengine utlises it then. Unfortunately I can only get targa images to work in the Cryengine SDK :/

    Thanks for the info though, I'll see if there still is a GIMP crytiff plugin.

    EDIT: Bugger, I can't find a crytiff plugin and the .dds one I found does not work :| No fancy shaders for me! XD
  • Ashaman73
    Options
    Offline / Send Message
    Ashaman73 polycounter lvl 6
    Alpha handling in gimp is quite easy. First add the alpha channel as ZacD explained. Here you can although choose an existing alpha channel as alpha layer if you load an RGBA for example.

    Now you have to thumbnails in the layer view, the left one is the RGB view, the right one the alpha channel. Press left mouse button on each of this thumbnails to switch between them. The selected one get a white border (not easy to recognise) and all operations like painting, copy'n'paste ,color manipulation will be done on the selected one.

    Clicking with the left mouse button on the right/alpha view while holding eiterh Ctrl or Alt, you can only view the alpha channel (green border) or disable the alpha channel (red border).

    There are several ways to copy an existing image (greyscale) into the alpha channel, here's one:
    1. open your normal map.
    2. add transparency to layer.
    3. load specmap as new layer. (should be of same size to simplify the process).
    4. left click on spec map layer to select it, then Ctrl+C
    5. left click on alpha channel of normal map to select it, then Ctrl+V
    6. press the anchors icon
    7. delete spec map layer
    8. export
  • JFinn_UK
    Options
    Offline / Send Message
    JFinn_UK polycounter lvl 7
    Ashaman73 wrote: »
    Alpha handling in gimp is quite easy. First add the alpha channel as ZacD explained. Here you can although choose an existing alpha channel as alpha layer if you load an RGBA for example.

    Now you have to thumbnails in the layer view, the left one is the RGB view, the right one the alpha channel. Press left mouse button on each of this thumbnails to switch between them. The selected one get a white border (not easy to recognise) and all operations like painting, copy'n'paste ,color manipulation will be done on the selected one.

    Clicking with the left mouse button on the right/alpha view while holding eiterh Ctrl or Alt, you can only view the alpha channel (green border) or disable the alpha channel (red border).

    There are several ways to copy an existing image (greyscale) into the alpha channel, here's one:
    1. open your normal map.
    2. add transparency to layer.
    3. load specmap as new layer. (should be of same size to simplify the process).
    4. left click on spec map layer to select it, then Ctrl+C
    5. left click on alpha channel of normal map to select it, then Ctrl+V
    6. press the anchors icon
    7. delete spec map layer
    8. export

    That's exactly what I did but when I do so the image becomes a semi transparent mess, although by the sounds of it that's normal then? If so then otherwise I can't export from GIMP in a suitable format since this didn't work in targa (and for some reason regular old tiff images don't work in the Cryengine 3)
  • e-freak
    Options
    Offline / Send Message
    No, Tiff Files work just fine, but they have no additional Meta-Data to tell the Engine what they are doing. What the Engine then does is assuming that the Tiff is saved with the default settings (diffuse_lowQ).

    What the CryTiff Plugin in Photoshop does (or at least how it can be best described) is save a Tiff File and then call the rc.exe (to be found in bin32/rc/) with the files location and the desired Texture Parameters. Check the rc.ini to find the different Names you can call. The RC then writes the necessary conversion data into the Tiff File-Header.

    Note: The CryTiff Files are not in any way further compressed, damaged or corrupted by this operation. They are merely including an additional node now for the next step.

    In the next step, upon calling the Texture, the Engine reads the CryTiff and checks if a DDS version already exists for that texture. If not (or the DDS doesn't fit to the CryTiff's Data) it will compile a DDS which will have the ideal settings for that specific texture format.

    An easy example for this is the Displacement Map: A displacement Map is supposed to be just Greyscale. If you would just save a standard DDS it would not have an Alpha Channel and horrible compressed RGB channels. Now, if you look into the DDS specifications, there a different ways to compress DDS textures. One of them is to save only the Alpha Channel using full 8-Bits and killing RGB.

    You could in theory save all your textures as DDS yourself and choose your own compressions, but a) that would take a ton of work on your side and b) you would have to figure out all the DDS settings your self and c) you have to make backup uncompressed copies of all your textures.

    What CryTiff does is, it saves for you an uncompressed Tif File, using the RC's presets you always get the best compression method easily (and if you were to develop for consoles, it would pick the best compression per Platform automatically) and last but not least: It has nice features like "Bump2Normal", which can save you additional trouble.
  • Ashaman73
    Options
    Offline / Send Message
    Ashaman73 polycounter lvl 6
    mrjimmy wrote: »
    That's exactly what I did but when I do so the image becomes a semi transparent mess, although by the sounds of it that's normal then? If so then otherwise I can't export from GIMP in a suitable format since this didn't work in targa (and for some reason regular old tiff images don't work in the Cryengine 3)
    The semi transparent mess is the desired goal :) To view only either the RGB or alpha part, hold ctrl or alt and click on the alpha thumbnail.

    When exporting your image, just add the necessary file extension, ie. .tga for targa, .png or .jpg. When exporting you often get an message, that the target fileformat is not suitable, this is because most file formats do not support layers etc. Just ignore it.

    If you want to keep the layers etc., then save the file in .xcf or .xcfbz2 (compressed version)
  • JFinn_UK
    Options
    Offline / Send Message
    JFinn_UK polycounter lvl 7
    Well I ended up downloading the photoshop trial and after doing so I found out that I was saving .tiff files and I was supposed to be saving .tif files, although the gloss map in the specular alpha channel thing only worked when pasting the gloss map into the alpha in photoshop since in photoshop the alpha is left unaffected (because it allows me to create a custom channel called Alpha 1 to paste onto). I dunno what the need for this crytif plugin is though if it all works in photoshop anyway :s Also yeah when exported a .tif from photoshop without any plugin the cryengine was fine with it, automatically created the .dds file too (I was wondering what that was).

    Thanks for the replies
  • e-freak
    Options
    Offline / Send Message
    mrjimmy wrote: »
    I dunno what the need for this crytif plugin is though if it all works in photoshop anyway :s Also yeah when exported a .tif from photoshop without any plugin the cryengine was fine with it, automatically created the .dds file too (I was wondering what that was).

    did you read my post at all?
  • JFinn_UK
    Options
    Offline / Send Message
    JFinn_UK polycounter lvl 7
    Oh sorry I meant for my purposes I don't really need it, I imagine it'd be invaluable for game production though
Sign In or Register to comment.