Horizon trouble

CaseyB

26-09-2006 20:46:12

I am having trouble with the horizon in my app. The terrain doesn't go out as far as I would like so you send up seeing the ragged edge and seeing the tiles page in. I have tried to expand it, but nothing I change seems to make a difference. Here is my config file. The values after the # are the defualt values so you can see what I've changed.DefaultMap=Cleveland

# resource group name where to find map definition
GroupName=PLSM2

# Try forbidden textureformat combinations
TextureFormatDebug=no

VisibleRenderables=500 # 200
DistanceLOD=5 # 5
MaxRenderLevel=5 # 5
NumRenderablesLoading=50 # 50

MaxAdjacentPages=5 # 2
MaxPreloadedPages=3 # 3
ChangeFactor=1.5 # 1.5
CameraThreshold=10 # 5

MaxNumRenderables=512 # 256
IncrementRenderables=256 # 256
MaxNumTiles=512 # 256
IncrementTiles=256 # 256
HorizonVisibilityComputing=yes # yes
And here is the Cleveland.cfg that it referencesGroupName=PLSM2

Width=4
Height=4

Data2DFormat=HeightField
LandScapeFileName=Cleveland

Zip=../Media/materials/textures/Map.zip

NumTextureFormatSupported=19

TextureFormatSupported0=Image
TextureFormatSupported1=BaseTexture
TextureFormatSupported2=Splatting
TextureFormatSupported3=Splatting5
TextureFormat=Image
#ImageFilename=ClevelandTexture

ScaleX=15000
ScaleY=1000
ScaleZ=15000

Deformable=no
VertexProgramMorph=yes
VertexCompression=yes
VertexNormals=yes

NumMatHeightSplat=4
MaterialHeight1=21.75
MaterialHeight2=75
MaterialHeight3=100
SplatFilename0=splatting_sand.png
SplatFilename1=splatting_sand.png
SplatFilename2=splatting_sand.png
SplatFilename3=splatting_grass.png
What am I missing to make the terrain spread out more?

tuan kuranes

27-09-2006 15:26:13

playing with those values should work.
Here changing that with grand canyon does double visible distance.

VisibleRenderables=150
MaxAdjacentPages=2
MaxPreloadedPages=3
MaxNumRenderables=512
MaxNumTiles=512


Be sure far clip plane from camera is set to infinite or at least far enough

CaseyB

27-09-2006 19:11:45

I set the camera distance to infinite, and didn't see a change, so I commented out all of the lines in the config file except the Groupname and the DefaultMap so that it would reset to the defaults and there was still no change! I am really at a loss. The values in my config file don't seem to be doing anything!

davesh

27-09-2006 19:37:52

Tuan,
This conversation interests me. I would definitely like to better understand the parameters that you say should impact the "visible horizon". I've tried to achieve a similar effect and am having difficulty getting additional pages of terrain to display (except by moving the camera towards those pages). I need to have additional pages displayed because currently the edge of my landscape is too close and it looks extremely raggedy.

How can I better understand each of the following parameters?

VisibleRenderables=150
MaxAdjacentPages=2
MaxPreloadedPages=3
MaxNumRenderables=512
MaxNumTiles=512


Do I need to set each of these parameters in order to have additional pages paged in? Or do I just need to set the MaxAdjacentPages? How does VisibleRenderables and MaxNumRenderables relate to the number of pages that will be displayed?

Any discussion relative to this will be appreciated.

davesh

28-09-2006 00:04:32

I set the camera distance to infinite, and didn't see a change, so I commented out all of the lines in the config file except the Groupname and the DefaultMap so that it would reset to the defaults and there was still no change! I am really at a loss. The values in my config file don't seem to be doing anything!

I just noticed that you have set MaxPreloadedPages to less than MaxAdjacentPages . According to the wiki (http://www.ogre3d.org/wiki/index.php/Paging_Scene_Manager_config_files#Run_Time_Configuration_.28Plugin_Configuration.29)
this parameter must be greater than MaxAdjacentPages. Could the configuration be ignored by PLSM if something like this is wrong?

Wiki says:

MaxPreloadedPages: Must be bigger than MaxAdjacentPages + 1

tuan kuranes

28-09-2006 14:13:27

@CaseyB: check if it really use that cfg file... check if you do not have a paginglandscape2.cfg in binary directory AND media directory, etc.

@davesh:
VisibleRenderables is the radius number of tiles VISIBLE around camera.

MaxAdjacentPages is the radius number of pages LOADED around camera (aren't necessary visible as it depends on visible renderables.)

MaxPreloadedPages is the radius number of pages preloaded around camera
(as to be superior to MaxAdjacentPages as an adjacent pages has to be preloaded prior to be loaded.)

MaxNumRenderables, MaxNumTiles is the maximum number of renderables loadable at once.

ppClarity

28-09-2006 15:22:50

@davesh:
VisibleRenderables is the radius number of tiles VISIBLE around camera.

MaxAdjacentPages is the radius number of pages LOADED around camera (aren't necessary visible as it depends on visible renderables.)

MaxPreloadedPages is the radius number of pages preloaded around camera
(as to be superior to MaxAdjacentPages as an adjacent pages has to be preloaded prior to be loaded.)

MaxNumRenderables, MaxNumTiles is the maximum number of renderables loadable at once.

Well, that certainly clears up a lot, thanks! :D Is that in the documentation? It should be somewhere prominent.

CaseyB

28-09-2006 17:05:44

I have verified that it is using that cfg file becuase if I change the name of the default map to say, Cleveland1 it crashed and says that it can't fing Cleveland1.cfg. But then again I can't seem to get any of the other variables to do anything. I even changed it to this:DefaultMap=Cleveland

GroupName=PLSM2

VisibleRenderables=15
MaxAdjacentPages=1
MaxPreloadedPages=2
MaxNumRenderables=30
MaxNumTiles=30
Just to see if it changes anything and it doesn't! So it should SHOW 15 tiles, LOAD 1 page, PRELOAD 2 pages, and only RENDER 30 tiles. But the terrain still goes out as far as it did before. Here's a picture of what I am seeing with these settings.

tuan kuranes

28-09-2006 17:16:54

How do you load the map ?

CaseyB

28-09-2006 17:33:12

bool notFound = true;
SceneManagerEnumerator::MetaDataIterator it = root->getSceneManagerMetaDataIterator();
while (it.hasMoreElements ())
{
const SceneManagerMetaData* metaData = it.getNext ();

// A mask describing which sorts of scenes this manager can handle
if (metaData->sceneTypeMask == ST_EXTERIOR_REAL_FAR &&
metaData->worldGeometrySupported == true &&
metaData->typeName == "PagingLandScapeSceneManager")
{
notFound = false;
break;
}
}
if (notFound)
{
throw Exception(15, "Could not find Paging Landscape plugin. Check if it's in plugins.cfg.", "OgreApp.cpp");
}

sceneMgr = root->createSceneManager("PagingLandScapeSceneManager", "MainSceneManager");
sceneMgr->setWorldGeometry("terrain.cfg");

tuan kuranes

28-09-2006 17:42:40

Try to change texture mode just to check if you're doing it in the good .cfg file...
Still no clue...
If you try to tweak grand canyon file, you do see results of tweaking ?
Try in demo plsm2 and then try in you application, just to check.

CaseyB

28-09-2006 19:34:09

Today must just be my day to be an idiot! I was adding the lines in the equivilant of the paginglandscape2.cfg instead of the canyon_height_4k2k.cfg! This would be why my changes weren't making any difference! :oops: It's working now though! Thank you so much!