PLSM2 and large terrains

taniinim

14-02-2006 09:08:33

Greetings,

I've been working with Ogre and PLSM2 now for few months. I'm facing a difficulty when trying to render large data sets with PLSM2. The terrain data I'm using consist of 128x64 pages, 65x65 each (texture is 512x512). The problem is that the demo runs OK for a while, but seemingly I'm getting out-of-memory problems after a while (one minute or so).

It seems that PLSM2 does not unload the pages and/or textures properly. It might be so that I just don't have the right configuration, as I'm not sure what configuration parameters affect what.

Currently my terrain config file is as follows (with some irrelevant lines removed):


Width=128
Height=64
PageSize=65
TileSize=17

NumRenderablesLoading=3
RenderableLoadInterval=10

MaxAdjacentPages=5
MaxPreloadedPages=7
PageLoadInterval=10

MaxNumRenderables=128
IncrementRenderables=64
MaxNumTiles=128
IncrementTiles=64


I'm using just the base texture for rendering, no splatting etc. I've been trying different values for tile size (even 65 == 1 tile/page), and for the other settings too, but it still crashes. I'm using the demo_paginglandscapemanager2 example application with no modifications. I've pulled the code I'm using from CVS HEAD some weeks ago, the current HEAD doesn't compile for me ATM.

I'm also having problems with infinite terrain, is there an option for it? I think it was mentioned on a wiki page, but I can't find a way to enable it. The thing I'm trying to accomplish is to "wrap" the terrain so that I could simulate torus or spherical topology (edgeless terrain). Is this kind of functionality available, or any idea how could I implement it without going too deep into the PLSM2 implementation?

br,

- tuomas

tuan kuranes

14-02-2006 09:41:17

memory problem was fixed a week ago.

the current HEAD doesn't compile for me ATM
you have to update Ogre CVS Head too.

Infinite terrain was disussed but never done.

Not to hard to fake (if all your data is related to page/tiles and not in absolute position), hard to do it really.

To fake it just make data loading (heightmap and texture) use a modulo, and enlarges plsm2 width and height.
(if requesting page(5.5) on a terrain of (4.4), transform page data request page(5%4,5%4) which gives page(1,1) and update plsm2 width and height to terrain(5,5).
It's Fake becase first page(1,1) absolute Vector3 position would be different from faked page(5%4,5%4).

So this need a reworked paginglandscape2data2d , paginglandscape2texture subclasses, and new Option being AbosluteHeight and AbsoluteWidth number of page to be used as modulo operand.