[Help] newbie dynamic terrain not being displayed

tleiades

18-03-2007 09:16:19

Hi

I am trying to use PLSM2 in the SDK version as the terrain manager in an alternate implementation for a second life viewer. At the moment I am only at the POC stage, playing around with different options.

For those that doesn't know, SecondLife is a virtual world, where the world is divided up into a grid of "Regions", i.e. you contact a server responsible for a specific "Region" and it will transfer a height map to the client. Since I never really have a complete map of the world, it really isnt possble/practical to run map splitter on a complete map.

For the current POC I have generated 9.000.000 height maps, arranged in a 3.000 x 3.000 grid (needless to say, that will not be the final implementation). the height maps and textures get loaded without any warnings or errors reported. But no terrain gets rendered.

I do get FPS/CPU hits when moving around on the "terrain", but not a single vertex gets rendered. I am currently using ambient lights only.

Some posts say that "you must run mapsplitter", so now I am beginning to wonder, is it possible to do what I want? If so, what do I need to get the terrain to display?

Grom

18-03-2007 11:05:48

you definately have to run mapsplitter, although in the next version of PLSM I think the Scene Manager will actually run it automatically for you if the heightmap you pass isn't split (but I assume it still won't rescale it for you).

From your description I wonder if maybe the terrain did get drawn, it was just way up above your camera (1000's of units)

9 million heightmaps?

tleiades

18-03-2007 12:10:31

The problem is, that at no point in time do I have the complete map, for the POC I can generate the maps locally, but it won't be possble once I get past the POC stage.

My plan was to write a custom archive, and combine that with the preloadpage event, to supply the individual heightmap files at run time. That way I wouldn't have to store the 9 million height maps, all I would have to store was a cache of the heightmaps in the immediate vicinity of the camera, and then download the maps on a "need to download basis"

I'm starting to suspect that the mapsplitter performs some "magic", for handling lighting and shadows and that this may invalidate my POC.

tleiades

18-03-2007 17:07:33

I am starting to suspect that it is my .cfg file which is at fault, could you take a look at it an point me at any errors?

GroupName=General


HeightMapExtension=slhm
HeightMapFileName=RegionHeightMap
Data2DFormat=HeightFieldRaw

ImageFilename=GrassTexture
ImageExtension=png
TextureExtension=png

# number of pages
Width=3000
Height=3000

# tile size, how to divy up pages
TileSize=65

# size of a page
PageSize=257

VertexCompression=yes
VertexProgramMorph=yes
LODMorphStart=0.2
MaxPixelError=3

NumTextureFormatSupported=2
TextureFormatSupported0=ImagePaging
TextureFormatSupported1=Base
#TextureFormatSupported2=Splatting
#TextureFormatSupported3=Image
# the one selected
#TextureFormatDebug=yes
TextureFormat=ImagePaging

#NumMatHeightSplat=4
MaterialHeight0=0
MaterialHeight1=12
MaterialHeight2=60
MaterialHeight3=75

#needs to be in Search Path directory (resources.cfg)
SplatFilename0=splatting_sand.png
SplatFilename1=splatting_grass.png
SplatFilename2=splatting_rock.png
SplatFilename3=splatting_snow.png

################## PERFORMANCES OPTIONS.
#VisibleRenderables=12
#DistanceLOD=5
#NumRenderablesLoading=50

VertexLit=yes

MaxAdjacentPages=3
MaxPreloadedPages=4
ChangeFactor=1.5
CameraThreshold=5

PageWorldX=0
PageWorldZ=0
MaxValue=3000
MinValue=0

ScaleX=1
ScaleY=1
ScaleZ=1

PositionX=0
PositionY=0
PositionZ=0

nindim

18-03-2007 21:04:18

Your width and height is 3000.... you know that thats in pages yeah? ie. with a page size of 513 and a heightmap of 1025 you would have a height and width of 2. I think what you're looking for is scaleX,scaleY and scaleZ, they define the size of a page (in world units).

use like this:

ScaleX=3000
ScaleY=3000
ScaleZ=3000

tleiades

18-03-2007 21:41:50

Actually I do mean 3000 x 3000 pages :-) which is why I am looking at a paging landscape in the first place. But it is obvious from your mail that I completely misunderstood the Scale? parameter.

Thanks :-)

nindim

18-03-2007 21:46:28

Yeah, having the scale values all set to 1 would just mean your terrain is pretty much non existent! Let us know if it fixes the problem. I only skimmed the post so didnt see that your map was actually 9000 pages, thats pretty big :)

tleiades

18-03-2007 23:26:58

Yay :D

Correcting the Scale? parameters did the trick, I am seeing the landscape now. Thank you for your help.