I've changed the blend mode of the detailmap to 8. This makes the terrain a bit brighter and it the colour is pretty much the same as on the texture, instead of BlitzTerrain dulling it down.
While testing, I have found some pretty cool effects, like making the terrain look darker (how it used to be) would be cool for night time environments and making it really bright to make it look like a sunny environment. I will create a function called BT SetDetailBlendMode(TerrainID,blendmode) to set these blend modes. The blend modes are listed on the DirectX website, somewhere.
I didn't get round to making that workaround. Its still on my todo list.
My workaround is simple, but it may decrease the FPS a little. Simply, draw a line around each and every sector. I discovered when I render a wireframe and a solid terrain at the same time, the pinholes completely go!
The pinholes are not caused by the LOD. I still have no idea where they came from in the first place. They have been around in every single terrain engine I've ever made :S.
I've looked through the system step by step. The core system uses integers, it scales the final object to the scale you set, so you can set a floating point as the scale and it would still use integers to create the terrain
Anyway, for the GDK users, here's the BlitzTerrain Header. Obviously, you cant use it yet, but its just so you can see/comment on how I have done things. And get anything you don't like changed before the release.
#ifndef _BLITZTERRAIN_H
#define _BLITZTERRAIN_H
//Functions
unsigned long BT_MakeTerrain();
void BT_SetTerrainHeightmap(unsigned long terrainid,unsigned long image);
void BT_SetTerrainColourHeightmap(unsigned long terrainid,unsigned long image);
void BT_SetTerrainTexture(unsigned long terrainid,unsigned long image);
void BT_SetTerrainExclusion(unsigned long terrainid,unsigned long image);
void BT_SetTerrainExclusionThreshold(unsigned long terrainid,unsigned long threshold);
void BT_SetTerrainDetail(unsigned long terrainid,unsigned long image);
void BT_SetTerrainDetailBlendMode(unsigned long terrainid,unsigned char mode);
void BT_SetTerrainEnvironment(unsigned long terrainid,unsigned long image);
void BT_SetTerrainLOD(unsigned long terrainid,char LODLevels);
void BT_SetTerrainSplit(unsigned long terrainid,unsigned long Split);
void BT_SetTerrainDetailTile(unsigned long terrainid,float Tile);
void BT_SetTerrainQuadReduction(unsigned long terrainid,bool Enabled);
void BT_SetTerrainQuadRotation(unsigned long terrainid,bool Enabled);
void BT_SetTerrainSmoothing(unsigned long terrainid,bool Enabled);
void BT_SetTerrainScale(unsigned long terrainid,float Scale);
void BT_SetTerrainYScale(unsigned long terrainid,float YScale);
void BT_SetTerrainLODDistance(unsigned long terrainid,unsigned long LODLevel,float value);
void BT_BuildTerrain(unsigned long terrainid,unsigned long ObjectID);
int BT_ContinueBuild();
void BT_DeleteTerrain(unsigned long TerrainID);
float BT_GetGroundHeight(unsigned long terrainid,float x,float z);
float BT_GetTerrainSize(unsigned long terrainid);
unsigned long BT_GetPointExcluded(unsigned long terrainid,float x,float z);
char* BT_GetVersion();
void BT_EnableAutoRecovery(bool enabled);
void BT_SetBuildStep(unsigned long step);
void BT_SetATMode(bool ATMode);
unsigned long BT_GetStatistic(unsigned long code);
unsigned long BT_GetTerrainObjectID(unsigned long terrainid);
void BT_MakePhyObject(unsigned long terrainid,unsigned long LODLevel,unsigned long SectorID,unsigned long ObjectID);
void BT_MakeSectorObject(unsigned long terrainid,unsigned long LODLevel,unsigned long SectorID,unsigned long ObjectID);
float BT_GetSectorPositionX(unsigned long terrainid,unsigned long LODLevel,unsigned long SectorID);
float BT_GetSectorPositionY(unsigned long terrainid,unsigned long LODLevel,unsigned long SectorID);
float BT_GetSectorPositionZ(unsigned long terrainid,unsigned long LODLevel,unsigned long SectorID);
unsigned long BT_GetSectorCount(unsigned long TerrainID,unsigned long LODLevel);
float BT_GetSectorSize(unsigned long TerrainID,unsigned long LODLevel);
unsigned long BT_GetSectorExcluded(unsigned long terrainid,unsigned long LODLevel,unsigned long SectorID);
unsigned long BT_GetSectorRow(unsigned long terrainid,unsigned long LODLevel,unsigned long SectorID);
unsigned long BT_GetSectorCollumn(unsigned long terrainid,unsigned long LODLevel,unsigned long SectorID);
void BT_SetCurrentCamera(unsigned long CameraID);
void BT_UpdateTerrainLOD(unsigned long TerrainID);
void BT_UpdateTerrainCull(unsigned long TerrainID);
void BT_UpdateTerrain(unsigned long TerrainID);
void BT_RenderTerrain(unsigned long TerrainID);
unsigned long BT_LoadTerrain(char* FileName,unsigned long ObjectID);
void BT_SaveTerrain(unsigned long TerrainID,char* FileName);
//Libs
#pragma comment(lib,"BlitzTerrain.lib")
//Classes for Object Oriented Programmers
#ifdef BT_USINGOOP
//TERRAIN CLASS
class BT_Terrain
{
public:
BT_Terrain();
~BT_Terrain();
unsigned long GetID() {return ItsID;}
void SetHeightmap(unsigned long image) {BT_SetTerrainHeightmap(ItsID,image);}
void SetColourHeightmap(unsigned long image) {BT_SetTerrainColourHeightmap(ItsID,image);}
void SetTexture(unsigned long image) {BT_SetTerrainTexture(ItsID,image);}
void SetExclusion(unsigned long image) {BT_SetTerrainExclusion(ItsID,image);}
void SetExclusionThreshold(unsigned long threshold) {BT_SetTerrainExclusionThreshold(ItsID,threshold);}
void SetDetail(unsigned long image) {BT_SetTerrainDetail(ItsID,image);}
void SetDetailBlendMode(unsigned char mode) {BT_SetTerrainDetailBlendMode(ItsID,mode);}
void SetEnvironment(unsigned long image) {BT_SetTerrainEnvironment(ItsID,image);}
void SetLOD(char LODLevels) {BT_SetTerrainLOD(ItsID,LODLevels);}
void SetSplit(unsigned long Split) {BT_SetTerrainSplit(ItsID,Split);}
void SetDetailTile(float Tile) {BT_SetTerrainDetailTile(ItsID,Tile);}
void SetQuadReduction(bool Enabled) {BT_SetTerrainQuadReduction(ItsID,Enabled);}
void SetQuadRotation(bool Enabled) {BT_SetTerrainQuadRotation(ItsID,Enabled);}
void SetSmoothing(bool Enabled) {BT_SetTerrainSmoothing(ItsID,Enabled);}
void SetScale(float Scale) {BT_SetTerrainScale(ItsID,Scale);}
void SetYScale(float YScale) {BT_SetTerrainYScale(ItsID,YScale);}
void SetLODDistance(unsigned long LODLevel,float value) {BT_SetTerrainLODDistance(ItsID,LODLevel,value);}
void Build(unsigned long ObjectID) {BT_BuildTerrain(ItsID,ObjectID);}
void DeleteTerrain() {BT_DeleteTerrain(ItsID);}
float GetGroundHeight(float x,float z) {BT_GetGroundHeight(ItsID,x,z);}
float GetSize() {BT_GetTerrainSize(ItsID);}
unsigned long GetPointExcluded(float x,float z) {BT_GetPointExcluded(ItsID,x,z);}
unsigned long GetObjectID() {BT_GetTerrainObjectID(ItsID);}
void MakePhyObject(unsigned long LODLevel,unsigned long SectorID,unsigned long ObjectID) {BT_MakePhyObject(ItsID,LODLevel,SectorID,ObjectID);}
void MakeSectorObject(unsigned long LODLevel,unsigned long SectorID,unsigned long ObjectID) {BT_MakeSectorObject(ItsID,LODLevel,SectorID,ObjectID);}
float GetSectorPositionX(unsigned long LODLevel,unsigned long SectorID) {BT_GetSectorPositionX(ItsID,LODLevel,SectorID);}
float GetSectorPositionY(unsigned long LODLevel,unsigned long SectorID) {BT_GetSectorPositionY(ItsID,LODLevel,SectorID);}
float GetSectorPositionZ(unsigned long LODLevel,unsigned long SectorID) {BT_GetSectorPositionZ(ItsID,LODLevel,SectorID);}
unsigned long GetSectorCount(unsigned long LODLevel) {BT_GetSectorCount(ItsID,LODLevel);}
float GetSectorSize(unsigned long LODLevel) {BT_GetSectorSize(ItsID,LODLevel);}
unsigned long GetSectorExcluded(unsigned long LODLevel,unsigned long SectorID) {BT_GetSectorExcluded(ItsID,LODLevel,SectorID);}
unsigned long GetSectorRow(unsigned long LODLevel,unsigned long SectorID) {BT_GetSectorRow(ItsID,LODLevel,SectorID);}
unsigned long GetSectorCollumn(unsigned long LODLevel,unsigned long SectorID) {BT_GetSectorCollumn(ItsID,LODLevel,SectorID);}
void UpdateLOD() {BT_UpdateTerrainLOD(ItsID);}
void UpdateCull() {BT_UpdateTerrainCull(ItsID);}
void Update() {BT_UpdateTerrain(ItsID);}
void Render() {BT_RenderTerrain(ItsID);}
void Save(char* FileName) {BT_SaveTerrain(ItsID,FileName);}
private:
unsigned long ItsID;
};
//CONSTRUCTOR AND DESTRUCTOR
BT_Terrain::BT_Terrain()
{
ItsID=BT_MakeTerrain();
}
BT_Terrain::~BT_Terrain()
{
BT_DeleteTerrain(ItsID);
}
#endif
#endif