History: Ogre Terrain Textures
Source of version: 3
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
1) Get ShaderMap CL from http://www.shadermap.renderingsystems.com/
2) Create a bat file with the following contents:
CODE: SELECT ALL
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
Replace the directory and texture name with what you want to generate maps for.
3) Generate the maps by running the bat script, once for each texture.
4) Use the following code to combine the images:
CODE: SELECT ALL
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");
5) Get the nVidida texture tools (DDS Utilities) and convert the output textures to dds.
6) Done.
!Pixplant