Skip to main content

History: Ogre Terrain Textures

Source of version: 10

Copy to clipboard
            {TRANSCLUDE(page="Layout_div6", img="1492")}How to create textures for use with the Ogre Terrain Component{TRANSCLUDE}
{maketoc}
!Introduction
The default material generator of the Ogre Terrain Component uses two textures per layer:
Normal_height and Diffuse_specular.
It's important to have the textures in the right format, otherwise the terrain is not going to look right.

The following shows three possible ways to create a working set of terrain textures.

---
!ShaderMap CL
# Get ShaderMap CL from [http://www.shadermap.renderingsystems.com/]
# Create a bat file with the following contents:
+ {CODE(wrap="1",colors="winbatch")}CD "C:\Program Files\ShaderMap CL 1.2.2"

START /WAIT shadermap.exe cdiff "<texture_directory>\<texture_name>" -disp (60,100,12,xy) -norm (100,200,xy,0) -spec (100,-50,52,xy) -v{CODE}
+ Replace the directory and texture name with what you want to generate maps for.
# Generate the maps by running the bat script, once for each texture.
# Use the following C++ code to combine the images:
+ {CODE(wrap="1", colors="c++")}   Ogre::Image combined;

   combined.loadTwoImagesAsRGBA("moos1.jpg", "moos1_SPEC.bmp", 
      Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::PF_BYTE_RGBA);
   combined.save("moos1_diffusespecular.png");

   combined.loadTwoImagesAsRGBA("moos1_NORM.tga", "moos1_DISP.bmp", 
      Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::PF_BYTE_RGBA);
   combined.save("moos1_normalheight.png");{CODE}
# Get the nVidida texture tools (DDS Utilities) and convert the output textures to dds.
# Done. 

---
!PixPlant
[http://www.pixplant.com/|PixPlant] is powered by Ogre and is a highly recommended texture tool!

# Fire up PixPlant and {MONO()}File->Load Texture->dirt.jpg{MONO}
# Adjust the Intensity value of the Specular channel - too much will make the terrain look weird. -80 is about right, but it depends on the source texture, naturally.
# {MONO()}File->Save All 3D Material Map{MONO}s..
# You should now have four different textures:
+ {CODE(wrap="1")}dirt_DIFFUSE.png
dirt_DISP.png
dirt_NORMAL.png
dirt_SPECULAR.png{CODE}
# Use the code from previous section to combine the textures into Diffuse_specular, Normal_height textures.
---
!The Gimp
You work on the layer mask. It's like an alpha channel but with a different name BUT gimp doesn't see it as an alpha channel until you apply it.

Therefore, on the image you're already working, go to the Layer window (if you don't have it, menu Windows->Dockable Windows->Layers):

# Right click on the layer you want to add an alpha channel
# Add layer Mask
# Grayscale copy of layer or blank whatever fits your needs. You can later paste something else
# Once you're finished, "Apply Mask Layer". That will turn the mask layer into the alpha channel.

I prefer opening the file in the regular way (not "Open as Layers").
To work on individual channels (except alpha, you work on it as a "mask") I recommend using the channel window (Windows->Dockable Windows->Channels) and selecting one channel allows you to work on one channel at a time (including copy-pasting)

If you need DDS support, you can try the GIMP DDS plugin, but it has basic support and you may be better off with a dedicated tool.

        

History

Information Version
Sat 14 of Feb, 2015 01:34 GMT-0000 raffamaiden 26
Sat 14 of Feb, 2015 01:22 GMT-0000 raffamaiden 25
Thu 30 of Aug, 2012 11:38 GMT-0000 duststorm 24
Thu 30 of Aug, 2012 11:38 GMT-0000 duststorm 23
Thu 30 of Aug, 2012 11:36 GMT-0000 duststorm 22
Thu 30 of Aug, 2012 11:36 GMT-0000 duststorm 21
Thu 30 of Aug, 2012 11:33 GMT-0000 duststorm 20
Thu 30 of Aug, 2012 11:32 GMT-0000 duststorm Added png to terrain tex conversion script 19
Thu 23 of Aug, 2012 22:01 GMT-0000 duststorm 18
Thu 23 of Aug, 2012 22:00 GMT-0000 duststorm 17
Thu 23 of Aug, 2012 21:59 GMT-0000 duststorm 16
Thu 23 of Aug, 2012 21:54 GMT-0000 duststorm 15
Thu 23 of Aug, 2012 21:53 GMT-0000 duststorm Added imageMagick explanation 14
Tue 09 of Aug, 2011 12:13 GMT-0000 uzik Added NetPBM 13
Wed 08 of Sep, 2010 23:47 GMT-0000 harkathmaker Clarified GIMP procedure 12
Thu 17 of Jun, 2010 10:17 GMT-0000 jacmoe 11
Thu 17 of Jun, 2010 10:15 GMT-0000 jacmoe 10
Thu 17 of Jun, 2010 10:14 GMT-0000 jacmoe 9
Thu 17 of Jun, 2010 07:44 GMT-0000 jacmoe 8
Thu 17 of Jun, 2010 07:40 GMT-0000 jacmoe 7
Thu 17 of Jun, 2010 07:38 GMT-0000 jacmoe 6
Thu 17 of Jun, 2010 07:37 GMT-0000 jacmoe 5
Thu 17 of Jun, 2010 07:36 GMT-0000 jacmoe 4
Thu 17 of Jun, 2010 07:35 GMT-0000 jacmoe 3
Thu 17 of Jun, 2010 07:29 GMT-0000 jacmoe 2