Since we're on the subject, ANYWAY, can someone PLEASE help me so that I can embed my detailmap into my texture map for my terrain?
I've tried MANY different texture stages, including 0,1... 1,2... etc..
and it turns out wrong EVERY time or doesnt work AT ALL. :/
Here's the code:
//Load media
global g_HeightmapImgID : global g_TextureImgID : global g_DetailmapImgID
g_HeightmapImgID=1 : g_TextureImgID=2 : g_DetailmapImgID=3
load image "..\Media\heightmap.bmp",g_HeightmapImgID, 1
load image "..\Media\texture.jpg",g_TextureImgID, 1
load image "..\Media\detail.tga",g_DetailmapImgID, 0
global terrainbuild = 1
if terrainbuild = 0
//Create terrain
//Make the terrain
global g_TerrainID
g_TerrainID=BT MakeTerrain()
//Set images
BT SetTerrainHeightmap g_TerrainID,g_HeightmapImgID
BT SetTerrainTexture g_TerrainID,g_TextureImgID
BT SetTerrainDetail g_TerrainID,g_DetailmapImgID
//Set some other values
BT SetTerrainScale g_TerrainID,12.0
BT SetTerrainYScale g_TerrainID,2.0
BT SetTerrainSplit g_TerrainID,16
BT SetTerrainDetailTile g_TerrainID,4.0
//LOD
BT SetTerrainLOD g_TerrainID,4 //3 LOD levels
BT SetTerrainLODDistance g_TerrainID,1,1000.0 //LOD Distances start at one and go up to 1 less the LOD level count
BT SetTerrainLODDistance g_TerrainID,2,2000.0
//Smoothing (you can set the smoothing factor from 0 - 100)
BT SetTerrainSmoothing g_TerrainID,1
//Build
global g_TerrainObjectID
g_TerrainObjectID=1
//This command processes the heightmap and creates all the internal structures for the terrain
BT BuildTerrain g_TerrainID,g_TerrainObjectID,1
bt maketerrainobject g_TerrainID, 2, 10001
set object smoothing 10001, 100
`make mesh from object 10002, 10001, 0
`save mesh "Terrain.X", 10002
if file exist("Terrain.X") = 1 then delete file "Terrain.X"
save_x(10001, "Terrain.X")
else
load object "Terrain.X", 1
position object 1, 0, 0, 0
scale object 1, 1024, 1024, 1024
set object smoothing 1, 100
texture object 1, 1, g_TextureImgID
texture object 1, 2, g_DetailmapImgID
endif
CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !