How To/Use GIMP to create a PBRMetal parameters image

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
(1st version)
 
(Tutorial updated to reflect layout changes in GIMP)
Line 6: Line 6:
 
= GIMP =
 
= GIMP =
  
GIMP (GNU Image Manipulation Program) is a free image painting program available from the [https://www.gimp.org/ GIMP website].  The version used for this tutorial is GIMP 2.8.22.  Version 2.10.6 (latest) also works with this process.
+
GIMP (GNU Image Manipulation Program) is a free image painting program available from the [https://www.gimp.org/ GIMP website].  The version used for this tutorial is GIMP 2.10.2.
  
 
= Process =
 
= Process =
Line 31: Line 31:
  
 
For convenience, the file names reflect the channel id and the type of texture.  The emissive and ambient occlusion textures are plain colours but the  
 
For convenience, the file names reflect the channel id and the type of texture.  The emissive and ambient occlusion textures are plain colours but the  
roughness and metallic have shades of grey.
+
roughness and metallic have shades of grey. Here is how the channels look in Images2TGA:
 +
[[File:red - emissive channel in Images2TGA.jpg]]
 +
[[File:Green_-_roughness_channel_in_Images2TGA.jpg]]
 +
[[File:Blue_-_AO_channel_in_Images2TGA.jpg]]
 +
[[File:Alpha_-_metallic_channel_in_Images2TGA.jpg]]
 +
 
  
 
== Actions ==
 
== Actions ==
  
* Start GIMP.  You will need the Layers and Channels window open. You may find it useful to run GIMP as a single window. (Windows->Single-Window Mode)
+
* Start GIMP.  You will need the Layers and Channels windows open. If those windows are not visible then look in the Windows drop down menu -> Dockable Dialongs (or Ctrl L). You may also find it useful to run GIMP as a single window. (Windows->Single-Window Mode)
 
* Select the Layers tab.  It should be empty.
 
* Select the Layers tab.  It should be empty.
 +
 +
[[File:GIMP_channels_and_layers.jpg]]
  
 
== Load the channel images ==
 
== Load the channel images ==
  
* Use the "Open as Layers" control (Ctrl+Alt+O) to load the red channel image.  The emissive image is displayed. You should see the red channel image in the layers panel.
+
* Use the "Open as Layers" control (Ctrl+Alt+O) to load the red (emissive) channel image.  The emissive image is displayed.  
* Use the "Open as Layers" control to load the green channel imageNote that the image in the main display is replaced. The green channel image should be in the layers panel.
+
* Repeat for the green (roughness), blue (AO) and alpha channel (metallic) images.
* Repeat for the blue channel (AO) image and the alpha channel (metallic) image.
+
* On completion, the GIMP window should look like the followingThe four "channels" are loaded as layers and the channels of the image are the product of those layers. The channels will be black for this example.
 +
* The order of the layers is not important.
  
 +
[[File:GIMP merged channels.jpg]]
  
 +
* Save the data as a new image in XCF format.  This will preserve the layers.  Use a name like working_parameters.xcf or whatever suits you.
  
[[File:GIMP - after loading channel files.jpg]] 
+
== Composing the channels ==
  
* Save the data as a working image in XCF format. This will preserve the layersUse a name like working_parameters.xcf or whatever suits you.
+
* Use the Image->Mode->Grayscale command to change the image to greyscale. GIMP will change to a single channel called Gray plus an alphaThe Gray channel will probably be black.  
  
== Composing the channels ==
+
[[File:GIMP - after grayscale.jpg]]
  
* Use the Image->Mode->Grayscale command to change the image to greyscale.
 
 
* Open the Compose Channels dialog using the Colors->Components->Compose command.  You may want to widen the dialog box as the filenames can be long.
 
* Open the Compose Channels dialog using the Colors->Components->Compose command.  You may want to widen the dialog box as the filenames can be long.
 
* Change the Color model to RGBA.
 
* Change the Color model to RGBA.
Line 61: Line 70:
 
* Select OK and a new image is created and should look like the image below. GIMP treats the image as being partially transparent due to the alpha channel.
 
* Select OK and a new image is created and should look like the image below. GIMP treats the image as being partially transparent due to the alpha channel.
  
[[File:GIMP - parameters image.jpg]]
+
[[File:GIMP_-_parameters_image.jpg]]  
  
* Make sure the parameters image is selected and export as a TGA uncompressed file.  GIMP uses a default name and probably PNG, so you will need to change that.
+
* Make sure the parameters image is selected and export as a TGA uncompressed or PNG file.  
* You may want to save your working image, i.e.the one that shows the last channel image loaded which is probably the alpha channel.
+
 
* The exported image should look like the following image as shown in Images2TGA.
 
* The exported image should look like the following image as shown in Images2TGA.
  
Line 71: Line 79:
 
== Making an Emissive channel in GIMP ==
 
== Making an Emissive channel in GIMP ==
  
Rather than making an emissive image you can manufacture it within GIMP.  This can be useful if you want zero emissive (black) or some inner glow (greys),  See [[M.pbrmetal]] for more information.
+
Rather than making an emissive image you can manufacture it within GIMP.  This can be useful if you want zero emissive (black) or some self illumination (greys),  See [[M.pbrmetal]] for more information.
  
 
* Instead of importing an emissive image create a new layer and fill the background with the colour of your choice.
 
* Instead of importing an emissive image create a new layer and fill the background with the colour of your choice.

Revision as of 19:27, 22 July 2019

Contents

Introduction

This tutorial demonstrates how to create a PBRMetal parameters image within GIMP.


GIMP

GIMP (GNU Image Manipulation Program) is a free image painting program available from the GIMP website. The version used for this tutorial is GIMP 2.10.2.

Process

This tutorial only discusses the use of uncompressed Targa (TGA). These files use 8 bits for each channel so a RGBA texture would have 4 * 8 = 32 bits per pixel. Trainz will accept PNG files and PNG files may work with this process.

Using your own images

This assumes you have your own images for use in the:

  • Red Channel - Emissive
  • Green Channel - Roughness channel
  • Blue Channel - Ambient occlusion
  • Alpha Channel - Metallic

These files should all have the same dimensions, the same size as the target parameters file, and correctly sized for Trainz purposes.

Four images are provided for tutorial purposes and can be found in File:GIMP-parameters-tute-images.zip:

  • red_channel-emissive.tga
  • green_channel-roughness.tga
  • blue_channel-ao.tga
  • alpha_channel-metallic.tga

For convenience, the file names reflect the channel id and the type of texture. The emissive and ambient occlusion textures are plain colours but the roughness and metallic have shades of grey. Here is how the channels look in Images2TGA: Red - emissive channel in Images2TGA.jpg Green - roughness channel in Images2TGA.jpg Blue - AO channel in Images2TGA.jpg Alpha - metallic channel in Images2TGA.jpg


Actions

  • Start GIMP. You will need the Layers and Channels windows open. If those windows are not visible then look in the Windows drop down menu -> Dockable Dialongs (or Ctrl L). You may also find it useful to run GIMP as a single window. (Windows->Single-Window Mode)
  • Select the Layers tab. It should be empty.

GIMP channels and layers.jpg

Load the channel images

  • Use the "Open as Layers" control (Ctrl+Alt+O) to load the red (emissive) channel image. The emissive image is displayed.
  • Repeat for the green (roughness), blue (AO) and alpha channel (metallic) images.
  • On completion, the GIMP window should look like the following. The four "channels" are loaded as layers and the channels of the image are the product of those layers. The channels will be black for this example.
  • The order of the layers is not important.

GIMP merged channels.jpg

  • Save the data as a new image in XCF format. This will preserve the layers. Use a name like working_parameters.xcf or whatever suits you.

Composing the channels

  • Use the Image->Mode->Grayscale command to change the image to greyscale. GIMP will change to a single channel called Gray plus an alpha. The Gray channel will probably be black.

GIMP - after grayscale.jpg

  • Open the Compose Channels dialog using the Colors->Components->Compose command. You may want to widen the dialog box as the filenames can be long.
  • Change the Color model to RGBA.
  • For each channel change the link to the appropriate input file. After this the dialog should look something like the following:

GIMP - compose channels.jpg

  • Select OK and a new image is created and should look like the image below. GIMP treats the image as being partially transparent due to the alpha channel.

GIMP - parameters image.jpg

  • Make sure the parameters image is selected and export as a TGA uncompressed or PNG file.
  • The exported image should look like the following image as shown in Images2TGA.

GIMP - parameters image in Images2TGA.jpg

Making an Emissive channel in GIMP

Rather than making an emissive image you can manufacture it within GIMP. This can be useful if you want zero emissive (black) or some self illumination (greys), See M.pbrmetal for more information.

  • Instead of importing an emissive image create a new layer and fill the background with the colour of your choice.


See also: M.pbrmetal


<< How To Guides

Personal tools