History: Ogre Terrain Textures
Source of version: 7
Copy to clipboard
{TRANSCLUDE(page="Layout_div6", img="1492")}How to create textures for use with the Ogre Terrain Component{TRANSCLUDE}
{maketoc}
!Introduction
!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 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]
!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.